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