Open
Conversation
Introduced changes: - pre-commit config and rules - Flake8 is covered in the pre-commit hooks. - Applying fixes for pre-commit compliance in all code. Also it is worth to note that commit hash will be used instead of version tags in pre-commit to prevend arbitrary code from running in developer's machines. pre-commit will be used to: - trailing whitespace; - Replaces or checks mixed line ending (mixed-line-ending); - Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker); - Checks that non-binary executables have a proper shebang (check-executables-have-shebangs); - Check for files that contain merge conflict strings (check-merge-conflict); - Check for debugger imports and py37+ breakpoint() calls in python source (debug-statements); - Attempts to load all yaml files to verify syntax (check-yaml); - Run flake8 checks (flake8) (local) For further details about tests please refer to: https://github.com/pre-commit/pre-commit-hooks
Contributor
|
Thank you. I'll review this after I finish releasing Celery 5. |
Contributor
Author
|
@thedrow thanks |
Contributor
Author
|
Hello @thedrow, An update about these changes? |
auvipy
requested changes
Oct 20, 2021
Member
auvipy
left a comment
There was a problem hiding this comment.
i think only the merge conflicts should be fixed here
| - id: debug-statements | ||
| - id: check-yaml | ||
| files: .*\.(yaml|yml)$ | ||
| - repo: https://gitlab.com/pycqa/flake8 |
Member
There was a problem hiding this comment.
isn't it available in github as well?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The rationale behind these changes is to catch linter errors (pep8) automatically before developers submit their changes and pull-requests.
These changes will help us become proactive with the apply of our coding rules (pep8, etc...) and avoid back and forth with patches and reviews.
In other words these changes could help us to reduce our CI usages and possibly also help us to reduce the amount (of pending) reviews by catching early issues on the developer side.
Note that pre-commit is optional and people who don't want to use it don't need to do something.
With these changes
toxis plugged onpre-committo run flake8 checks, this approach allow us to centralize things and avoid to duplicate how this kind of test is executed.Introduced changes:
Also it is worth to note that commit hash will be used instead of version tags
in pre-commit to prevend arbitrary code from running in developer's machines.
pre-commit will be used to:
shebang (check-executables-have-shebangs);
calls in python source (debug-statements);
Also these changes can be used automatically by using:
With the previous commands checks will be passed at each commit by using git-hooks' mechanisms.
For further details about tests please refer to: https://github.com/pre-commit/pre-commit-hooks
Also note that the changes on
docs/make.batare simply file permissions to render this file as an executable file.