.pre-commit-config.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. exclude: ^(data/.*|.vscode/.*|poetry.lock)$
  2. default_language_version:
  3. python: python3.11
  4. repos:
  5. - repo: https://github.com/commitizen-tools/commitizen
  6. # Please run `pre-commit install --hook-type commit-msg` to check commit messages
  7. rev: v3.20.0
  8. hooks:
  9. - id: commitizen
  10. - repo: https://github.com/pre-commit/pre-commit-hooks
  11. rev: v4.5.0
  12. hooks:
  13. - id: check-yaml
  14. - id: check-json
  15. - id: check-toml
  16. - id: end-of-file-fixer
  17. - id: trailing-whitespace
  18. - id: detect-private-key
  19. - id: check-case-conflict
  20. - id: check-ast
  21. - id: check-added-large-files
  22. args: ["--maxkb=1000"]
  23. # Integrate filename spell checking https://github.com/streetsidesoftware/cspell/issues/3063
  24. # currently using `make cspell-filenames` as a workaround.
  25. - repo: https://github.com/streetsidesoftware/cspell-cli.git
  26. rev: v8.6.0
  27. hooks:
  28. - id: cspell
  29. name: cspell
  30. additional_dependencies:
  31. - "@cspell/dict-de-ch"
  32. - "@cspell/dict-en-gb"
  33. args:
  34. - "lint"
  35. - "--show-suggestions"
  36. - "--no-must-find-files"
  37. - "--locale"
  38. - "en-GB,de-CH"
  39. - repo: https://github.com/hadolint/hadolint
  40. rev: v2.12.1-beta
  41. hooks:
  42. - id: hadolint
  43. - repo: https://github.com/astral-sh/ruff-pre-commit
  44. rev: v0.3.4
  45. hooks:
  46. - id: ruff
  47. types_or: [python, pyi, jupyter]
  48. args: ["--fix"]
  49. # to be replaced by https://github.com/astral-sh/ruff/issues/458
  50. - repo: https://github.com/jsh9/pydoclint
  51. rev: 0.4.1
  52. hooks:
  53. - id: pydoclint
  54. - repo: https://github.com/asottile/pyupgrade
  55. rev: v3.15.2
  56. hooks:
  57. - id: pyupgrade
  58. args: [--py311-plus]
  59. - repo: https://github.com/hadialqattan/pycln
  60. rev: v2.4.0
  61. hooks:
  62. - id: pycln
  63. name: pycln (python)
  64. args: [--config=pyproject.toml]
  65. - repo: local
  66. hooks:
  67. - id: poetry-install
  68. name: Install project deps
  69. entry: poetry install
  70. language: system
  71. always_run: false
  72. types: [python]
  73. pass_filenames: false
  74. stages: [commit, merge-commit, push, manual]
  75. - id: mypy
  76. name: Run mypy
  77. entry: poetry run mypy ocma
  78. language: system
  79. always_run: false
  80. types: [python]
  81. pass_filenames: false
  82. stages: [commit, merge-commit, push, manual]
  83. - id: pylint
  84. name: Run pylint
  85. entry: poetry run pylint -j 0 ocma
  86. language: system
  87. always_run: false
  88. types: [python]
  89. pass_filenames: false
  90. stages: [commit, merge-commit, push, manual]
  91. - id: run-tests
  92. name: Run tests
  93. entry: poetry run pytest
  94. language: system
  95. always_run: false
  96. types: [python]
  97. pass_filenames: false
  98. stages: [commit, merge-commit, push, manual]