-
Notifications
You must be signed in to change notification settings - Fork 1
/
.pre-commit-config.yaml
158 lines (158 loc) · 4.64 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
minimum_pre_commit_version: 1.21.0
repos:
- repo: meta
hooks:
# - id: check-hooks-apply
- id: check-useless-excludes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-ast
- id: check-json
- id: check-toml
- id: check-yaml
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
types: [file, text]
exclude_types: [html, javascript]
- id: end-of-file-fixer
types: [file, text]
exclude_types: [html, javascript]
- id: check-case-conflict
- id: mixed-line-ending
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-merge-conflict
name: "Check for merge conflicts"
- id: check-yaml
name: "Yaml: Check files"
types: [file, yaml]
- id: check-toml
name: "TOML: check toml syntax"
types: [file, toml]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.2
hooks:
- id: check-github-workflows
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.35.1 # or higher tag
hooks:
- id: yamllint
name: "Yaml: Linting files"
args: [--format, parsable, --strict]
types: [file, yaml]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-tabs
name: "Python: Convert Tabs to 4 spaces"
args: ['--whitespaces-count', '4'] # defaults to: 4
types: [file, python]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
name: "Python: upgrade syntax"
args: [--py310-plus]
- repo: https://github.com/hadialqattan/pycln
rev: v2.4.0
hooks:
- id: pycln
name: "Python: remove unused imports."
- repo: https://github.com/rbroderi/precommithooks
rev: v1.0.2
hooks:
- id: python_file_name_check
name: "Python: File name check"
args: ["--ignore-test-files"]
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.2
hooks:
# Run the linter.
- id: ruff
name: "Python: Ruff"
types: [file, python]
args: [--fix]
fail_fast: true
# Run the formatter.
- id: ruff-format
name: "Python: Ruff format"
types: [file, python]
fail_fast: true
- repo: local
hooks:
- id: pylint
name: "Python: Pylint code with Perflint"
entry: python -m pylint
language: system
types: [file, python]
args: [-rn, -sn, --load-plugins=perflint]
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: add-trailing-comma
name: "Python: Add trailing comma"
types: [file, python]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.10.0'
hooks:
- id: mypy
name: "Python: Checking variable types"
args: [--ignore-missing-imports, --allow-redefinition]
exclude: "setup[.]py|conf[.]py"
additional_dependencies:
- pydantic
- types-all
- pandas-stubs
types: [file, python]
- repo: https://github.com/PyCQA/bandit
rev: '1.7.8'
hooks:
- id: bandit
name: "Python: Checking for potential security issues (bandit)"
args:
- "--skip=B404,B506,B607,B603,B701,B101,B602"
- repo: local
hooks:
- id: remove-en-dashes
name: Remove the EXTREMELY confusing unicode character U+2013
language: system
entry: perl -pi* -e 's/\xe2\x80\x93/-/g && ($t = 1) && print STDERR $_; END{{exit $t}}'
types: [file]
types_or: [python, powershell, lua, jinja]
- repo: https://github.com/sirosen/texthooks
rev: 0.6.6
hooks:
- id: fix-smartquotes
types: [file]
types_or: [python, powershell, lua, jinja]
- id: fix-ligatures
types: [file]
types_or: [python, powershell, lua, jinja]
- id: forbid-bidi-controls
types: [file]
types_or: [python, powershell, lua, jinja]
fail_fast: true
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.13.0
hooks:
- id: pretty-format-java
args: [--autofix]
- id: pretty-format-golang
args: [--autofix]
- id: pretty-format-ini
args: [--autofix]
- id: pretty-format-rust
args: [--autofix]
- repo: local
hooks:
- id: fixes
name: fixes
entry: just _fixes_no_ruff
language: system
pass_filenames: false
verbose: true