.pre-commit-config.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. repos:
  2. - repo: https://github.com/pre-commit/pre-commit-hooks
  3. rev: v4.6.0
  4. hooks:
  5. - id: check-added-large-files
  6. args: ['--maxkb=512']
  7. - id: check-case-conflict
  8. - id: check-merge-conflict
  9. - id: check-symlinks
  10. - id: detect-private-key
  11. - id: end-of-file-fixer
  12. - id: trailing-whitespace
  13. files: \.(md|c|cc|cxx|cpp|cu|h|hpp|hxx|py)$
  14. - repo: https://github.com/Lucas-C/pre-commit-hooks
  15. rev: v1.5.1
  16. hooks:
  17. - id: remove-crlf
  18. - id: remove-tabs
  19. files: \.(md|c|cc|cxx|cpp|cu|h|hpp|hxx|py)$
  20. - repo: local
  21. hooks:
  22. - id: clang-format
  23. name: clang-format
  24. description: Format files with ClangFormat
  25. entry: bash .precommit/clang_format.hook -i
  26. language: system
  27. files: \.(c|cc|cxx|cpp|cu|h|hpp|hxx|cuh|proto)$
  28. # For Python files
  29. - repo: https://github.com/psf/black.git
  30. rev: 24.4.2
  31. hooks:
  32. - id: black
  33. files: (.*\.(py|pyi|bzl)|BUILD|.*\.BUILD|WORKSPACE)$
  34. # Flake8
  35. - repo: https://github.com/pycqa/flake8
  36. rev: 7.0.0
  37. hooks:
  38. - id: flake8
  39. args:
  40. - --count
  41. - --select=E9,F63,F7,F82,E721
  42. - --show-source
  43. - --statistics
  44. # check license
  45. - repo: local
  46. hooks:
  47. - id: check-custom
  48. name: Check Custom
  49. entry: python .precommit/check_custom.py
  50. language: python
  51. files: \.py$