-
Notifications
You must be signed in to change notification settings - Fork 101
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
Move all linters to pre-commit. #1164
Conversation
b9923a9
to
c3aa228
Compare
df93db9
to
1cb817c
Compare
This fixes some tests.
Those checkers are not able to work on single files present in a commit but need conecptionally work on the whole repository (check-manifest) and thus are not suited to be run before each commit, but only in the CI.
73ad299
to
3743bf1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, just some suggestions.
These are mostly documentation changes. Some of the docstrings might influence the public availability of the methods on an object. Co-authored-by: Michael Howitz <[email protected]>
@dataflake What do you think about these changes? |
Reviewing 260 files with a bunch of changes is insane. I am missing information what those changes are about. Is it all just changing comment formatting? Secondly, I still don't know what the change in developer experience is. What exactly does this switch to pre-commit do? Does it now force-run stuff on every commit? Locally? Remotely? Does it make changes to my commits that I cannot control? Do I get explicit feedback what changes are made? I have no idea what this really does. |
@dataflake wrote:
@dataflake I am now going to split this PR into smaller chunks, which are reviewable. The changes are either about formatting or changing the code to a newer style. So the changes should not be dramatic.
Let me explain a bit:
Was my explanation helpful? |
See #1224 as the first step. |
Like I said in #1224, I'd like some way to run those same things that GHA would run manually in my sandbox, and I don't want anything auto-committed. |
Things are looking good. How do we move forward? @sallner mentioned a few other tools that could be integrated into pre-commit like docformatter, teyit or sphinx-lint. |
I added the next steps to the description of this PR. Let me first land the PR in config/meta (including to find out what is needed so fixes can be committed by GHA (like in this PR which did not happen in zope.browserpage)), then I'll create individual PRs for the remaining tools. |
The goals of this PR were implemented in zope/meta a while ago. I have copied the additional tools mentioned here to zopefoundation/meta#284. |
This is a first attempt to solve #1031. Hopefully the PR will get corrected with the current github action configuration.
I have chosen to use GHA over pre-commit.ci directly, as it is not possible to deactivate the autoupdates of the hooks in pre-commit.ci. The lite version via GHA does no autoupdates at all.
The aim would be to update the hooks only in zopefoundation/meta.
I intentionally did not run the pre-commit hook on my local machine to show the functionality on GHA. This way I also tried to separate the generated code changes with my manual ones.
Open issues/ideas:
sphinx-lint
to lint the rst files, see https://github.com/pytest-dev/pytest-rerunfailures/pull/255/files as an example