.pre-commit-config.yaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. # Optionally remove from local hooks with 'rm .git/hooks/pre-commit'
  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. # Exclude directories (optional)
  11. # exclude: 'docs/'
  12. # Define repos to run
  13. repos:
  14. - repo: https://github.com/pre-commit/pre-commit-hooks
  15. rev: v4.5.0
  16. hooks:
  17. - id: end-of-file-fixer
  18. - id: trailing-whitespace
  19. - id: check-case-conflict
  20. # - id: check-yaml
  21. - id: check-docstring-first
  22. - id: detect-private-key
  23. - repo: https://github.com/asottile/pyupgrade
  24. rev: v3.15.0
  25. hooks:
  26. - id: pyupgrade
  27. name: Upgrade code
  28. - repo: https://github.com/astral-sh/ruff-pre-commit
  29. rev: v0.1.11
  30. hooks:
  31. - id: ruff
  32. args: [--fix]
  33. - repo: https://github.com/executablebooks/mdformat
  34. rev: 0.7.17
  35. hooks:
  36. - id: mdformat
  37. name: MD formatting
  38. additional_dependencies:
  39. - mdformat-gfm
  40. - mdformat-frontmatter
  41. - mdformat-mkdocs
  42. args:
  43. - --wrap=no
  44. - --number
  45. exclude: 'docs/.*\.md'
  46. # exclude: "README.md|README.zh-CN.md|CONTRIBUTING.md"
  47. - repo: https://github.com/codespell-project/codespell
  48. rev: v2.2.6
  49. hooks:
  50. - id: codespell
  51. exclude: "docs/de|docs/fr|docs/pt|docs/es|docs/mkdocs_de.yml"
  52. args:
  53. - --ignore-words-list=crate,nd,ned,strack,dota,ane,segway,fo,gool,winn,commend,bloc,nam,afterall
  54. - repo: https://github.com/hadialqattan/pycln
  55. rev: v2.4.0
  56. hooks:
  57. - id: pycln
  58. args: [--all]
  59. #
  60. # - repo: https://github.com/PyCQA/docformatter
  61. # rev: v1.7.5
  62. # hooks:
  63. # - id: docformatter
  64. # - repo: https://github.com/asottile/yesqa
  65. # rev: v1.4.0
  66. # hooks:
  67. # - id: yesqa
  68. # - repo: https://github.com/asottile/dead
  69. # rev: v1.5.0
  70. # hooks:
  71. # - id: dead
  72. # - repo: https://github.com/ultralytics/pre-commit
  73. # rev: bd60a414f80a53fb8f593d3bfed4701fc47e4b23
  74. # hooks:
  75. # - id: capitalize-comments