Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[infra] Add black checks to CI and pre-commit hooks #218

Merged
merged 17 commits into from
Jan 27, 2023

Conversation

ferbetanzo
Copy link
Collaborator

Fixes #165.

Besides adding a black check step to the CI (check-examples.yml), this PR also adds a .pre-commit-config.yaml necessary for enabling the pre-commit hooks.

pre-commit is added to the requirements.txt. So, after installing all the requirements, you can just use pre-commit install to have the checks run automatically before every commit. I've run it for all the python files and added the fixes to this PR.

I think we should mention the process of installing the pre-commit hooks, but I'm not sure if the README.md is the best place to do so (I don't see any dev-related section there).

Copy link
Collaborator

@cqc-melf cqc-melf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the right place to point this out for other would be a new created CONTRIBUTING.md file like in the tket repo at https://github.com/CQCL/tket/blob/develop/CONTRIBUTING.md

I have added a few comments and questions, let me know if something is unclear.

Thank you for adding this!

examples/pytket-qujax-classification.ipynb Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
.github/workflows/check-examples.yml Outdated Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
CONTRIBUTING.md Outdated
changes on the `main` branch, and open a PR from your fork. If it passes
the checks and is accepted after review, it will be merged in.
If there are any changes to the manual part of the repo the
manual needs to be rebuild locally.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
manual needs to be rebuild locally.
manual needs to be rebuilt locally.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for fixing it @cqc-melf :D !

pyproject.toml Show resolved Hide resolved
@ferbetanzo ferbetanzo merged commit bca57d7 into main Jan 27, 2023
@ferbetanzo ferbetanzo deleted the infra/black-checks branch January 27, 2023 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add black checks to the CI
3 participants