qiskit-advocate / qamp-spring-22

Qiskit advocate mentorship program (QAMP) spring 22 cohort (Mar - Jun 2022)
13 stars 1 forks source link

Qiskit Metal - During CI, offer user method to reformat file to be yapf. #41

Open priti-ashvin-shah-ibm opened 2 years ago

priti-ashvin-shah-ibm commented 2 years ago

Description

During CI, offer user method to reformat file to be yapf. We require all files to be formatted by yapf so the code "looks" similar. If the file is not formattted, the CI will fail. So, it would be nice to offer to reformat for the user. There are some files that have code which developers don't want to be reformatted to yapf. The solution of this project needs to address developer's wishes.

Deliverables

If CI fails due to non-formatted yapf file, provide a user-friendly solution.

Mentors details

Number of mentees

1

Type of mentees

priti-ashvin-shah-ibm commented 2 years ago

This is going to be worked on by Axel Ismirlian.

@axel ismirlian

ismirlia commented 2 years ago

I would like to work on this project.

priti-ashvin-shah-ibm commented 2 years ago

@HuangJunye , could you assign @axel ismirlian to this issue? I am not able to.

Post comment: I realized that the issues don't have people assigned. Please ignore my request.

ismirlia commented 2 years ago

This is the power point for the first checkpoint. qamp-checkpoint-1-axel-nick-gyeonghun-v2.pptx

ismirlia commented 2 years ago

Checkpoint 2

I have changed the script for the pre-commit hook. It now only runs yapf on the staged files, which runs faster. I have cut down on the number of dependencies needed to utilize the pre-commit hook. I tested on mac, windows and github desktop.

Here are some screen shots of what the error messages a user might get on different platformts.

github desktop github_desktop_screenshot

mac command line terminal_screenshot

I updated the github and the web documentation to include usage of the new pre-commit hook. I am waiting for final review.

ismirlia commented 2 years ago

@HuangJunye I was going to give a live short demo of my project tomorrow, so I don't have any slides to upload.

ismirlia commented 2 years ago

@HuangJunye Checkpoint 3 Here are some slides I threw together this morning. qamp-checkpoint-3-axel.pptx