-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CI] Add three pre-commit pygrep hooks #12933
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,6 +186,19 @@ repos: | |
| files: ^(LICENSE|NOTICE)$|README$|\.(bat|cfg|config|cs|css|erb|gitignore|header|in|install|java|md|properties|py|rb|rc|sh|sql|svg|te|template|txt|ucls|vue|xml|xsl|yaml|yml)$|^cloud-cli/bindir/cloud-tool$|^debian/changelog$ | ||
| args: [--markdown-linebreak-ext=md] | ||
| exclude: ^services/console-proxy/rdpconsole/src/test/doc/freerdp-debug-log\.txt$ | ||
| - repo: https://github.com/pre-commit/pygrep-hooks | ||
| rev: 3a6eb0fadf60b3cccfd80bad9dbb6fae7e47b316 # frozen: v1.10.0 | ||
| hooks: | ||
| - id: python-check-mock-methods | ||
| name: run check for not-real mock methods | ||
| description: Prevent common mistakes of assert mck.not_called(), assert mck.called_once_with(...) and mck.assert_called | ||
|
Comment on lines
+193
to
+194
|
||
| - id: python-use-type-annotations | ||
| name: run check for type annotations not comments | ||
| description: Enforce that python3.6+ type annotations are used instead of type comments | ||
| exclude: ^scripts/vm/hypervisor/xenserver/xenserver56/InterfaceReconfigure\.py$ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this one file skipped? I looked and it has no type comment in it. It just has a normal sentence that starts with the word "type". So any comment written like that in future will fail and end up added to this list. Is that ok? |
||
| - id: text-unicode-replacement-char | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This runs over every file in the repo. Is there a chance some test data has one of these characters on purpose? |
||
| name: run check for no unicode replacement char | ||
| description: Forbid files which have a UTF-8 Unicode replacement character | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3 | ||
| hooks: | ||
|
|
||
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.
Is this one adding anything for us right now?