-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
67 lines (62 loc) · 2.24 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
67 lines (62 loc) · 2.24 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
repos:
# Syntax validation and some basic sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0 # Released 2024-04-06
hooks:
- id: check-added-large-files
name: Checking for added large files
args: ["--maxkb=200"]
fail_fast: True
- id: check-case-conflict
name: Checking for name case conflicts
- id: check-merge-conflict
name: Checking for merge conflicts
- id: check-ast
name: Verifying Python file syntax
- id: check-json
name: Verifying JSON file syntax
- id: check-yaml
name: Verifying YAML file syntax
exclude: Helm/charts/.*?/templates/deployment\.yaml
args: [--allow-multiple-documents]
- id: check-toml
name: Verifying TOML file syntax
# Format the pyproject.toml file
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.8.0 # Released 2024-04-17
hooks:
- id: pyproject-fmt
name: Formatting the pyproject.toml file
additional_dependencies: ["tox>=4.9"]
# Format and lint using Ruff
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: ruff
name: Running Ruff linter
args: ["--fix"]
- id: ruff-format
name: Running Ruff formatter
# Type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1 # Released 2024-07-31
hooks:
- id: mypy
name: Checking types in Python scripts using MyPy
files: '(src|tests)/.*\.py$' # RegEx string showing directories and files to check
# Single quote critical due to escape character '\' used in the search string
# (see YAML specifications - 7.3 Flow Scalar Styles)
additional_dependencies: [
# Install missing stub packages
types-requests,
types-xmltodict,
types-PyYAML,
]
# Use Prettier to format other files
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.1.0 # Released 2023-11-13 | Latest stable version
hooks:
- id: prettier
name: Formatting other file types according to Prettier
exclude: Helm/charts/.*?/templates/deployment\.yaml
# types_or: [css, html, json, yaml]