|
| 1 | +# Pre-commit configuration file for code quality and formatting checks |
| 2 | +# In this repository we use 'prek' instead of 'pre-commit' to manage hooks. |
| 3 | +# Ensure that 'prek' is installed and used to run these hooks (documentation -> https://github.com/j178/prek). |
| 4 | + |
| 5 | +minimum_prek_version: "0.2.19" |
| 6 | + |
1 | 7 | default_language_version: |
2 | | - node: 16.15.0 |
3 | | - ruby: 2.7.2 |
| 8 | + node: 24.11.1 |
4 | 9 | python: python3.12 |
5 | 10 |
|
6 | 11 | repos: |
7 | | - # yaml formatting |
| 12 | + # Ruff - Python linter and formatter |
| 13 | + - repo: https://github.com/charliermarsh/ruff-pre-commit |
| 14 | + rev: v0.11.13 |
| 15 | + hooks: |
| 16 | + - id: ruff-check |
| 17 | + args: [--fix, --unsafe-fixes] |
| 18 | + - id: ruff-format |
| 19 | + |
| 20 | + # Prettier - Code formatter for UI files |
8 | 21 | - repo: https://github.com/pre-commit/mirrors-prettier |
9 | 22 | rev: v3.0.3 |
10 | 23 | hooks: |
11 | 24 | - id: prettier |
12 | 25 | exclude: ^application/ui/ |
13 | 26 |
|
14 | | - - repo: https://github.com/pre-commit/mirrors-mypy |
15 | | - rev: "v1.6.1" |
16 | | - hooks: |
17 | | - - id: mypy |
18 | | - alias: mypy_lib |
19 | | - name: mypy (library) |
20 | | - files: '^library/(src/otx)/.*\.py' |
21 | | - additional_dependencies: |
22 | | - [ |
23 | | - types-PyYAML, |
24 | | - attrs==21.2.*, |
25 | | - types-aiofiles, |
26 | | - types-requests, |
27 | | - types-Deprecated, |
28 | | - types-docutils, |
29 | | - types_futures, |
30 | | - types-setuptools, |
31 | | - types-python-dateutil, |
32 | | - tokenize-rt==3.2.0, |
33 | | - ] |
34 | | - args: [--disallow-untyped-calls, --config-file, library/pyproject.toml] |
35 | | - |
36 | | - - repo: https://github.com/pre-commit/mirrors-mypy |
37 | | - rev: "v1.12.0" |
38 | | - hooks: |
39 | | - - id: mypy |
40 | | - alias: mypy_backend |
41 | | - name: mypy (backend) |
42 | | - files: '^application/backend/.*\.py' |
43 | | - additional_dependencies: [types-PyYAML, types-aiofiles, types-requests] |
44 | | - args: |
45 | | - [ |
46 | | - --disallow-untyped-calls, |
47 | | - --config-file, |
48 | | - application/backend/pyproject.toml, |
49 | | - ] |
50 | | - |
| 27 | + # Hadolint - Dockerfile linter |
51 | 28 | - repo: https://github.com/AleksaC/hadolint-py |
52 | 29 | rev: v2.12.0.3 |
53 | 30 | hooks: |
54 | 31 | - id: hadolint |
55 | | - name: Lint Dockerfiles |
| 32 | + name: hadolint |
56 | 33 | description: Runs hadolint to lint Dockerfiles |
57 | 34 |
|
58 | | - - repo: https://github.com/shellcheck-py/shellcheck-py |
59 | | - rev: v0.9.0.6 |
60 | | - hooks: |
61 | | - - id: shellcheck # TODO remove this when all shell scripts have been removed from otx |
62 | | - |
63 | | - # markdown linting |
| 35 | + # Markdownlint - Markdown linter |
64 | 36 | - repo: https://github.com/igorshubovych/markdownlint-cli |
65 | | - rev: v0.37.0 |
| 37 | + rev: v0.46.0 |
66 | 38 | hooks: |
67 | 39 | - id: markdownlint |
68 | 40 | args: [--config=.markdownlint.yaml] |
69 | | - |
70 | | - # Ruff |
71 | | - - repo: https://github.com/charliermarsh/ruff-pre-commit |
72 | | - rev: v0.11.13 |
73 | | - hooks: |
74 | | - - id: ruff-check |
75 | | - args: [--fix, --unsafe-fixes] |
76 | | - - id: ruff-format |
0 commit comments