2
0

.pre-commit-config.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. default_language_version:
  2. python: python3
  3. exclude: |
  4. (?x)^(
  5. gdextension/extension_api\.json|
  6. gdextension/gdextension_interface\.h
  7. )$
  8. repos:
  9. - repo: https://github.com/pre-commit/mirrors-clang-format
  10. rev: v20.1.0
  11. hooks:
  12. - id: clang-format
  13. - repo: https://github.com/astral-sh/ruff-pre-commit
  14. rev: v0.11.4
  15. hooks:
  16. - id: ruff
  17. args: [--fix]
  18. files: (\.py|SConstruct)$
  19. types_or: [text]
  20. - id: ruff-format
  21. files: (\.py|SConstruct)$
  22. types_or: [text]
  23. - repo: https://github.com/pre-commit/mirrors-mypy
  24. rev: v1.14.1 # Latest version that supports Python 3.8
  25. hooks:
  26. - id: mypy
  27. files: \.py$
  28. types_or: [text]
  29. - repo: https://github.com/codespell-project/codespell
  30. rev: v2.4.1
  31. hooks:
  32. - id: codespell
  33. additional_dependencies: [tomli]
  34. - repo: https://github.com/BlankSpruce/gersemi
  35. rev: 0.19.2
  36. hooks:
  37. - id: gersemi
  38. args: ["-i", "--no-warn-about-unknown-commands", "-l", "120"]
  39. - repo: local
  40. hooks:
  41. - id: copyright-headers
  42. name: copyright-headers
  43. language: python
  44. entry: python misc/scripts/copyright_headers.py
  45. files: \.(c|h)pp$
  46. exclude: ^test/
  47. - id: header-guards
  48. name: header-guards
  49. language: python
  50. entry: python misc/scripts/header_guards.py
  51. files: \.hpp$
  52. exclude: ^test/
  53. - id: file-format
  54. name: file-format
  55. language: python
  56. entry: python misc/scripts/file_format.py
  57. types_or: [text]
  58. - id: check-get-file-list
  59. name: check-get-file-list
  60. language: python
  61. entry: python misc/scripts/check_get_file_list.py
  62. pass_filenames: false
  63. always_run: true
  64. stages: [manual]