-
-
Notifications
You must be signed in to change notification settings - Fork 435
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
55 lines (54 loc) · 2.36 KB
/
.pre-commit-config.yaml
File metadata and controls
55 lines (54 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ci:
autofix_commit_msg: "style: auto-fix by pre-commit.ci"
skip: [readme, config-types, schema-docs]
repos:
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.35.0
hooks:
- id: check-github-workflows
args: [ "--verbose" ]
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: "1.7.1"
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: v2.11.1
hooks:
- id: pyproject-fmt
args: ["--max-supported-python=3.14"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.14.9'
hooks:
- id: ruff-format
exclude: "^tests/data|^src/datamodel_code_generator/_types/"
- id: ruff
exclude: "^tests/data|^src/datamodel_code_generator/_types/"
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies:
- tomli
exclude: "^tests/|^CODE_OF_CONDUCT.md|^docs/cli-reference/"
- repo: local
hooks:
- id: readme
name: Update README command help
entry: bash -c '[ -x .tox/fix/bin/python ] && PYTHON=.tox/fix/bin/python || PYTHON=.tox/fix/Scripts/python; test -x "$PYTHON" || tox run -e fix --notest -qq; "$PYTHON" scripts/update_command_help_on_markdown.py'
language: system
files: ^(src/datamodel_code_generator/arguments\.py|README\.md|docs/index\.md)$
pass_filenames: false
- id: config-types
name: Generate config TypedDicts
entry: bash -c '[ -x .tox/dev/bin/python ] && PREFIX=.tox/dev/bin || PREFIX=.tox/dev/Scripts; test -x "$PREFIX/python" || tox run -e dev --notest -qq; "$PREFIX/datamodel-codegen" --profile generate-config-dict && "$PREFIX/datamodel-codegen" --profile parser-config-dicts && "$PREFIX/datamodel-codegen" --profile parse-config-dict'
language: system
files: ^src/datamodel_code_generator/config\.py$
pass_filenames: false
- id: schema-docs
name: Update schema feature documentation
entry: bash -c '[ -x .tox/schema-docs/bin/python ] && PYTHON=.tox/schema-docs/bin/python || PYTHON=.tox/schema-docs/Scripts/python; test -x "$PYTHON" || tox run -e schema-docs --notest -qq; "$PYTHON" scripts/build_schema_docs.py'
language: system
files: ^(src/datamodel_code_generator/parser/schema_version\.py|scripts/build_schema_docs\.py|docs/supported_formats\.md)$
pass_filenames: false