-
Notifications
You must be signed in to change notification settings - Fork 937
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
Pre-commit setup for the repo #1071
base: master
Are you sure you want to change the base?
Pre-commit setup for the repo #1071
Conversation
necessary changes to allow pylint to be a pre-commit hook as well, modernize setup process
take clang-format from google repo
Thanks @maichmueller ! Just a heads up: it will take a bit of time before we get to this as it involves learning a few things and discussion with the team. Also we have a release coming up that I would like to get out first (hopefully next week). |
We might import this (I think either way we will have to move to using pyproject.toml eventually) so I will look further into it eventually. Could you pull from master and push the merge commit to resolve the branch conflicts? |
This PR addresses what has been mentioned in #1070.
What this PR includes:
c++ project files formatting
google's python formatter that is close to black, but allows 2-indent formatting (oh the humanity...)
formatting style for cmake files
sort python imports alphabetically (can use profile=black, so I hope this profile works with pyink too)
the python formatter (commented out but added for when google policy on 2-indent changes)
using google's official configuration. Since this config enforces 2-indent, pyink is needed.
As a side effect of the pre-commit checks I have moved the setup definition into a
pyproject.toml
, since it allows to also write the configurations for some of these tools. In consequence:pyproject.toml
now holds the metadata of the project (version, authors, license, etc.)setup.py
is only the extension builderThe dev-tools needed to run these pre-commits have also been added to the the
pyproject.toml
as optional dependencies of the dev group and could then be installed via:or locally
If this PR is accepted a remark in the docs should be made for developers who wish to contribute the upstream to run
pre-commit install
on their repo in order to activate the hooks.