Damans227 commented on code in PR #12933:
URL: https://github.com/apache/cloudstack/pull/12933#discussion_r4387828147


##########
.pre-commit-config.yaml:
##########
@@ -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

Review Comment:
   Checked, nothing in the repo trips this today. Fine to keep as a guard. 
Resolving.



##########
.pre-commit-config.yaml:
##########
@@ -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
+      - 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$
+      - id: text-unicode-replacement-char

Review Comment:
   Checked, no tracked file has this character today, so it passes clean. 
Resolving.



##########
.pre-commit-config.yaml:
##########
@@ -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
+      - 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$

Review Comment:
   Could we reword the comment instead of skipping the whole file? Line 628 of 
InterfaceReconfigure.py says "# type parameter is a string...". Changing it to 
"# The type parameter is a string..." stops the match, and then the exclude can 
go:
   
   ```suggestion
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to