-
Notifications
You must be signed in to change notification settings - Fork 571
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 and pre-commit-ci #1672
pre-commit and pre-commit-ci #1672
Conversation
@eggplants Please have a look if you have a moment and let me know if you have any feedback. |
For a demo see: aucampia#33 I have enabled pre-commit CI now, but until this is merged it will always fail, it can be easily disabled from here: https://pre-commit.ci/ If we are in agreement on the settings there are the following options to actually run the hooks on the codebase:
Once this is done things will be fairly clean going forward, and each contributor can then either run |
dd82991
to
039096d
Compare
Pycln is fairly conservative on what it cleans, it does actually end up leaving a bunch of unused imports, but only because they have side effects, for more info see: https://hadialqattan.github.io/pycln/#/?id=side-effects |
eaa5a5e
to
515e605
Compare
I will disable pre-commit.ci until this is merged. Can be controlled using github IAM at https://results.pre-commit.ci/ for future reference. |
7aeefb2
to
e6aaa19
Compare
Rebased to master branch. I messed up the old demo, new one here: aucampia#35 |
Will split the tox changes off this also as those will actually make development quite a bit easier. |
Given some feedback on other issues I'm going to scale this back to only run black to begin with, we can add other things afterwards. |
tox changes split into #1691 |
6f7d0d9
to
2ac7771
Compare
Scaled this down to only do black. |
Add pre-commit and pre-commit-ci with the following hooks: - black for formatting code. For more info see `docs/developers.rst`.
2ac7771
to
b2e124d
Compare
Can be added later with the rest of isort.
This is to work around this issue: psf/black#2493 Without doing this the pre-commit hook for black fails as it thinks it got the wrong version.
fadf20a
to
3700b6c
Compare
I changed the hook slightly to work with the version spec in black config, for more info see psf/black#2493. Demo updated and re-run: aucampia#35 Will merge next week sometime. |
Add pre-commit and pre-commit-ci with the following hooks:
For more info see
docs/developers.rst
.