Zope
Zope copied to clipboard
Try out pre-commit.ci
FEATURE EXPERIMENT
What I did:
I hear some complaints about the necessity of commits to make flake8 or the other code checkers happy.
What I expect to happen:
Most of the issues could be fixed by a machine, so it should do it.
What actually happened:
I have to run tox
before the commit to see the problems which will arise in CI.
Suggestions
- Configure
pre-commit
to run the code checkers.- This allows developers with installed and activated
pre-commit
to automatically see the problems when committing and get them fixed if they are automatically fixable.
- This allows developers with installed and activated
- Configure repository to use https://pre-commit.ci to automatically run the pre-commit tests as CI system.
- It updates the PR if it finds fixable issues raised by the code checkers.
- Use https://github.com/isidentical/teyit to convert deprecated
unittest
assert calls.
Notes
- [ ] Configure
tox -elint
to runpre-commit
on all files to use the same configuration and to allow to keep existing habits. - [ ] Document how to install and activate
pre-commit
. - [ ] GHA no longer needs to run the
lint
environment. - [ ] This is an experiment, currently just the
Zope
repository should be part of it.
Thanks, happy to see that pre-commit
will be considered! :+1: #891
For what is worth: plone/meta
uses and benefits from it 😄
See https://github.com/plone/meta/blob/main/config/default/pre-commit-config.yaml.j2