-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
103 lines (94 loc) · 2.71 KB
/
.pre-commit-config.yaml
File metadata and controls
103 lines (94 loc) · 2.71 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
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
repos:
# Versioning: Commit messages & changelog
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.13.10
hooks:
- id: commitizen
stages: [commit-msg]
# Lint / autoformat: Python code
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.15.11"
hooks:
- id: ruff
files: ^(?:backend|auth-libs/python)/.*\.py$
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
files: ^(?:backend|auth-libs/python)/.*\.py$
# Deps: ensure Python uv lockfile is up to date
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.7
hooks:
- id: uv-lock
files: ^backend/pyproject\.toml$
args: [--project, backend]
- id: uv-lock
name: uv-lock-auth-libs-python
files: ^auth-libs/python/pyproject\.toml$
args: [--project, auth-libs/python]
# Upgrade: upgrade Python syntax
- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
files: ^(?:backend|auth-libs/python)/.*\.py$
# Lint: code cognitive complexity
- repo: https://github.com/rohaquinlop/complexipy-pre-commit
rev: v5.1.0
hooks:
- id: complexipy
files: ^(?:backend|auth-libs/python)/.*\.py$
# Spelling: Checks for common misspellings in text files.
- repo: https://github.com/crate-ci/typos
rev: v1
hooks:
- id: typos
pass_filenames: false
args:
- --exclude
- frontend/src/translations.ts
- --exclude
- auth-libs/web-component/dist/*
- --exclude
- auth-libs/web-component/src/*-i18n-*.ts
- --exclude
- auth-libs/web-component/src/translations.ts
- --exclude
- auth-libs/web-component/CHANGELOG.md
# Lint: Bash scripts
- repo: https://github.com/openstack-dev/bashate.git
rev: 2.1.1
hooks:
- id: bashate
types: [shell]
# Lint: Shell scripts
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
types: [shell]
args: ["-x", "--exclude=SC2317,SC2188,SC2143,SC2086,SC1091"]
# Lint: GH Workflows
- repo: https://github.com/rhysd/actionlint
rev: v1.7.12
hooks:
- id: actionlint
args: [-ignore, SC]
# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.48.0
hooks:
- id: markdownlint
args:
[
--fix,
--disable,
MD033,
--disable,
MD059,
--ignore,
LICENSE.md,
--ignore,
auth-libs/web-component/CHANGELOG.md,
--ignore,
.github,
]