Zope icon indicating copy to clipboard operation
Zope copied to clipboard

Try out pre-commit.ci

Open icemac opened this issue 2 years ago • 2 comments

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.
  • 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 run pre-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.

icemac avatar Apr 14 '22 05:04 icemac

Thanks, happy to see that pre-commit will be considered! :+1: #891

jugmac00 avatar Apr 14 '22 06:04 jugmac00

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

gforcada avatar Jun 30 '23 13:06 gforcada