.pre-commit-config.yaml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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.13.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. - repo: https://github.com/streetsidesoftware/cspell-cli.git
  24. rev: v8.1.1
  25. hooks:
  26. - id: cspell
  27. name: cspell
  28. additional_dependencies:
  29. - "@cspell/dict-de-ch"
  30. - "@cspell/dict-en-gb"
  31. args:
  32. - "lint"
  33. - "--show-suggestions"
  34. - "--no-must-find-files"
  35. - "--locale"
  36. - "en-GB,de-CH"
  37. - repo: https://github.com/astral-sh/ruff-pre-commit
  38. rev: v0.1.5
  39. hooks:
  40. - id: ruff
  41. types_or: [python, pyi, jupyter]
  42. args: ["--fix"]
  43. # to be replaced by https://github.com/astral-sh/ruff/issues/458
  44. - repo: https://github.com/jsh9/pydoclint
  45. rev: 0.3.8
  46. hooks:
  47. - id: pydoclint
  48. - repo: https://github.com/asottile/pyupgrade
  49. rev: v3.3.1
  50. hooks:
  51. - id: pyupgrade
  52. args: [--py311-plus]
  53. - repo: https://github.com/hadialqattan/pycln
  54. rev: v2.1.3
  55. hooks:
  56. - id: pycln
  57. name: pycln (python)
  58. args: [--config=pyproject.toml]
  59. - repo: local
  60. hooks:
  61. - id: poetry-install
  62. name: Install project deps
  63. entry: poetry install
  64. language: system
  65. always_run: false
  66. types: [python]
  67. pass_filenames: false
  68. stages: [commit, merge-commit, push, manual]
  69. - id: mypy
  70. name: Run mypy
  71. entry: poetry run mypy ocma
  72. language: system
  73. always_run: false
  74. types: [python]
  75. pass_filenames: false
  76. stages: [commit, merge-commit, push, manual]
  77. - id: pylint
  78. name: Run pylint
  79. entry: poetry run pylint -j 0 ocma
  80. language: system
  81. always_run: false
  82. types: [python]
  83. pass_filenames: false
  84. stages: [commit, merge-commit, push, manual]
  85. - id: run-tests
  86. name: Run tests
  87. entry: poetry run pytest
  88. language: system
  89. always_run: false
  90. types: [python]
  91. pass_filenames: false
  92. stages: [commit, merge-commit, push, manual]