forked from tjcsl/ion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pre-commit-config.yaml
43 lines (40 loc) · 1.26 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
default_stages: [commit, push]
fail_fast: false
exclude: ^(intranet/middleware|intranet/apps/.*/migrations|intranet/static/.*vendor/.*|intranet/.*/stubs|Ion.egg-info|\.github)
# This is for pre-commit ci
# After adding pre-commit ci, the "linting" stage of the tests
# can be safely deleted
ci:
autofix_commit_msg: |
chore: auto fixes from pre-commit hooks
for more information, see https://pre-commit.ci
autoupdate_commit_msg: 'build: pre-commit autoupdate'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
name: Validate Python
- id: trailing-whitespace
- id: mixed-line-ending
args: ["--fix=lf"]
- id: check-toml
- id: check-yaml
- id: detect-private-key
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: ruff
args: [ "--fix", "--exit-non-zero-on-fix" ]
name: ruff lint
files: ^intranet/apps/.*
- id: ruff-format
files: ^intranet/apps/.*
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
files: ^.*\.(py|md|rst)$
# TODO: Remove after python version >= 3.11
additional_dependencies:
- tomli