.pre-commit-config.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # Ultralytics YOLO 🚀, AGPL-3.0 license
  2. # Pre-commit hooks. For more information see https://github.com/pre-commit/pre-commit-hooks/blob/main/README.md
  3. exclude: 'docs/'
  4. # Define bot property if installed via https://github.com/marketplace/pre-commit-ci
  5. ci:
  6. autofix_prs: true
  7. autoupdate_commit_msg: '[pre-commit.ci] pre-commit suggestions'
  8. autoupdate_schedule: monthly
  9. # submodules: true
  10. repos:
  11. - repo: https://github.com/pre-commit/pre-commit-hooks
  12. rev: v4.4.0
  13. hooks:
  14. - id: end-of-file-fixer
  15. - id: trailing-whitespace
  16. - id: check-case-conflict
  17. # - id: check-yaml
  18. - id: check-docstring-first
  19. - id: double-quote-string-fixer
  20. - id: detect-private-key
  21. - repo: https://github.com/asottile/pyupgrade
  22. rev: v3.10.1
  23. hooks:
  24. - id: pyupgrade
  25. name: Upgrade code
  26. - repo: https://github.com/PyCQA/isort
  27. rev: 5.12.0
  28. hooks:
  29. - id: isort
  30. name: Sort imports
  31. - repo: https://github.com/google/yapf
  32. rev: v0.40.0
  33. hooks:
  34. - id: yapf
  35. name: YAPF formatting
  36. - repo: https://github.com/executablebooks/mdformat
  37. rev: 0.7.16
  38. hooks:
  39. - id: mdformat
  40. name: MD formatting
  41. additional_dependencies:
  42. - mdformat-gfm
  43. - mdformat-black
  44. # exclude: "README.md|README.zh-CN.md|CONTRIBUTING.md"
  45. - repo: https://github.com/PyCQA/flake8
  46. rev: 6.1.0
  47. hooks:
  48. - id: flake8
  49. name: PEP8
  50. - repo: https://github.com/codespell-project/codespell
  51. rev: v2.2.5
  52. hooks:
  53. - id: codespell
  54. args:
  55. - --ignore-words-list=crate,nd,strack,dota,ane,segway,fo
  56. # - repo: https://github.com/asottile/yesqa
  57. # rev: v1.4.0
  58. # hooks:
  59. # - id: yesqa
  60. # - repo: https://github.com/asottile/dead
  61. # rev: v1.5.0
  62. # hooks:
  63. # - id: dead