-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
.pre-commit-config.yaml
104 lines (94 loc) · 2.77 KB
/
.pre-commit-config.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
repos:
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.29.0
hooks:
- id: commitizen
stages: [commit-msg]
# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.6.4"
hooks:
# Run the linter
- id: ruff
files: ^src/backend/(?:.*/)*.*$
args: [--fix, --exit-non-zero-on-fix]
# Run the formatter
- id: ruff-format
files: ^src/backend/(?:.*/)*.*$
# Upgrade: upgrade Python syntax
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
# # Dead code: Python usused code detection
# - repo: https://github.com/asottile/dead
# rev: v1.5.2
# hooks:
# - id: dead
# args: ["--exclude", "contrib"]
# Spelling: Checks for common misspellings in text files.
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
types: [text]
args: [--toml, src/backend/pyproject.toml]
# Autoformat: YAML, JSON, Markdown, etc.
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.3
hooks:
- id: prettier
args:
[
--ignore-unknown,
--no-error-on-unmatched-pattern,
"!chart/**",
"!CHANGELOG.md",
"!CONTRIBUTING.md",
"!src/frontend/pnpm-lock.yaml",
"!src/backend/tests/test_data/**",
]
# # Lint: Dockerfile (disabled until binary is bundled)
# - repo: https://github.com/hadolint/hadolint.git
# rev: v2.12.1-beta
# hooks:
# - id: hadolint
# args:
# [
# "--ignore=DL3008",
# "--ignore=DL3013",
# "--ignore=DL3018",
# "--ignore=DL3059",
# ]
# Lint & Autoformat: SQL
- repo: https://github.com/sqlfluff/sqlfluff
rev: 3.1.1
hooks:
- id: sqlfluff-lint
files: ^src/backend/migrations/(?:.*/)*.*$
types: [sql]
- id: sqlfluff-fix
files: ^src/backend/migrations/(?:.*/)*.*$
types: [sql]
# Lint: Bash scripts
- repo: https://github.com/openstack-dev/bashate.git
rev: 2.1.1
hooks:
- id: bashate
files: ^(?!.*(?:^|/)contrib(?:/|$)).*$
# Lint: Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
files: ^(?!.*(?:^|/)contrib(?:/|$)).*$
args: ["-x", "--exclude=SC2317,SC2188,SC2143,SC2086,SC1091"]
# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.41.0
hooks:
- id: markdownlint
args:
[--fix, --disable, MD033, --ignore, CHANGELOG.md, --ignore, .github]