.pre-commit-config.yaml 693 B

12345678910111213141516171819202122232425262728293031323334
  1. repos:
  2. # 删除未使用导入和变量
  3. - repo: https://github.com/PyCQA/autoflake
  4. rev: v2.2.0
  5. hooks:
  6. - id: autoflake
  7. # 导入排序
  8. # - repo: https://github.com/PyCQA/isort
  9. # rev: 5.12.0
  10. # hooks:
  11. # - id: isort
  12. # args: ["--line-length=120"]
  13. # 格式化代码
  14. # - repo: https://github.com/psf/black
  15. # rev: 22.3.0
  16. # hooks:
  17. # - id: black
  18. # args: ["--line-length=120"]
  19. - repo: https://github.com/PyCQA/flake8
  20. rev: 5.0.4
  21. hooks:
  22. - id: flake8
  23. args: ["--max-line-length=120"]
  24. # 安全性检查
  25. # - repo: https://github.com/PyCQA/bandit
  26. # rev: 1.7.1
  27. # hooks:
  28. # - id: bandit
  29. fail_fast: false