|
@@ -0,0 +1,34 @@
|
|
|
+repos:
|
|
|
+ - repo: https://github.com/PyCQA/autoflake
|
|
|
+ rev: v2.2.0
|
|
|
+ hooks:
|
|
|
+ - id: autoflake
|
|
|
+
|
|
|
+ # 格式检查和自动格式化
|
|
|
+# - repo: https://github.com/PyCQA/isort
|
|
|
+# rev: 5.12.0
|
|
|
+# hooks:
|
|
|
+# - id: isort
|
|
|
+# args: ["--line-length=120"]
|
|
|
+
|
|
|
+ # 格式检查和自动格式化
|
|
|
+# - repo: https://github.com/psf/black
|
|
|
+# rev: 22.3.0
|
|
|
+# hooks:
|
|
|
+# - id: black
|
|
|
+# args: ["--line-length=120"]
|
|
|
+
|
|
|
+ #静态代码分析
|
|
|
+ - repo: https://github.com/PyCQA/flake8
|
|
|
+ rev: 5.0.4 # 或者使用你需要的版本号
|
|
|
+ hooks:
|
|
|
+ - id: flake8
|
|
|
+ args: ["--max-line-length=120"]
|
|
|
+
|
|
|
+ # 检查代码规范性、复杂性
|
|
|
+# - repo: https://github.com/PyCQA/bandit
|
|
|
+# rev: 1.7.1
|
|
|
+# hooks:
|
|
|
+# - id: bandit
|
|
|
+
|
|
|
+fail_fast: false
|