-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.pre-commit-config.yaml
83 lines (76 loc) · 2.35 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
repos:
### Run various small, general hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
# Git checks
- id: check-added-large-files
args: ["--maxkb", "1000"]
# - id: no-commit-to-branch
- id: check-merge-conflict
# General file checks
- id: destroyed-symlinks
- id: check-vcs-permalinks
- id: detect-private-key
- id: end-of-file-fixer
exclude: .idea/.*
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
args: ["--markdown-linebreak-ext=md"]
# Data format checks
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
args: ["--unsafe"] # Needed for some tags in `mkdocs.yml`
# Python specific checks
- id: check-ast
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable
- id: debug-statements
- id: fix-encoding-pragma
# Run the ruff linter
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
args: ["--fix", "--show-fixes", "--exit-non-zero-on-fix"]
# Run the black auto-formatter (TODO: Replace with ruff format when more mature)
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.3.0
hooks:
- id: black
# Run the isort auto-formatter (TODO: Replace with ruff format when more mature)
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
# Run the mypy type checker
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
args: ["--scripts-are-modules"]
additional_dependencies: ["pydantic==2.6.4", "textual==0.51.0"]
# verbose: true
# Run the vulture dead code detection tool
- repo: https://github.com/jendrikseipp/vulture
rev: v2.11
hooks:
- id: vulture
# Run the bandit security
- repo: https://github.com/PyCQA/bandit
rev: 1.7.8
hooks:
- id: bandit
args: ["--configfile", "pyproject.toml"]
# Validates GitHub workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.22.0
hooks:
- id: check-github-workflows