Skip to content

Commit ae81218

Browse files
committed
[MISC] pre-commit fixes
1 parent 5058d0d commit ae81218

File tree

2 files changed

+116
-11
lines changed

2 files changed

+116
-11
lines changed

.pre-commit-config.yaml

+116-10
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ci:
1414
1515
for more information, see https://pre-commit.ci
1616
autofix_prs: false
17-
autoupdate_branch: 'master'
17+
autoupdate_branch: ''
1818
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
1919
autoupdate_schedule: monthly
2020
skip: []
@@ -27,34 +27,81 @@ repos:
2727
hooks:
2828
# Identify invalid files
2929
- id: check-ast
30+
name: check-ast (Python)
31+
description: "Check for syntax errors in Python files."
32+
3033
- id: check-yaml
34+
name: check-yaml (YAML)
35+
description: "Check for syntax errors in YAML files."
36+
3137
- id: check-json
38+
name: check-json (JSON)
39+
description: "Check for syntax errors in JSON files."
40+
3241
- id: check-toml
42+
name: check-toml (TOML)
43+
description: "Check for syntax errors in TOML files."
44+
3345
- id: check-xml
46+
name: check-xml (XML)
47+
description: "Check for syntax errors in XML files."
3448

3549
# git checks
3650
- id: check-merge-conflict
51+
name: Check for merge conflict strings
52+
description: "Check for files that contain merge conflict strings."
53+
3754
- id: check-added-large-files
55+
name: Check for large files
56+
description: "Check for large files that were added to the repository."
3857
args:
3958
- --maxkb=1000
59+
4060
- id: detect-private-key
61+
name: Detect private key
62+
description: "Check for private keys in the repository."
63+
4164
- id: check-case-conflict
65+
name: Check for case conflicts
66+
description: "Check for files with names that differ only in case."
4267

4368
# Python checks
4469
- id: check-docstring-first
70+
name: Check for docstring in first line
71+
description: "Check that the first line of a file is a docstring."
72+
4573
- id: debug-statements
74+
name: Check for debug statements
75+
description: "Check for print statements and pdb imports."
76+
4677
- id: requirements-txt-fixer
78+
name: Fix requirements.txt
79+
description: "Fix the formatting of requirements.txt files."
80+
4781
- id: fix-encoding-pragma
82+
name: Fix encoding pragma
83+
description: "Fix the encoding pragma in Python files."
4884
args:
4985
- --remove
86+
5087
- id: fix-byte-order-marker
88+
name: Fix byte order marker
89+
description: "Fix the byte order marker in Python files."
90+
5191
- id: check-builtin-literals
92+
name: Check for built-in literals
93+
description: "Check for built-in literals in Python code."
5294

5395
# General quality checks
5496
- id: mixed-line-ending
97+
name: Mixed line ending
98+
description: "Check for mixed line endings."
5599
args:
56100
- --fix=lf
101+
57102
- id: trailing-whitespace
103+
name: Trailing whitespace
104+
description: "Check for trailing whitespace."
58105
args:
59106
- --markdown-linebreak-ext=md
60107
exclude: |
@@ -63,29 +110,43 @@ repos:
63110
locale/|
64111
static/(.*)/libs/
65112
)
113+
66114
- id: check-executables-have-shebangs
115+
name: Check for shebangs in executables
116+
description: "Check that executables have shebangs."
117+
67118
- id: end-of-file-fixer
119+
name: End of file fixer
120+
description: "Ensure that files end with a newline."
68121
exclude: |
69122
(?x)(
70123
.min(.css|.css.map|.js|.js.map)|
71124
locale/|
72125
static/(.*)/libs/
73126
)
74127
75-
- repo: https://github.com/pre-commit/mirrors-eslint
128+
- repo: https://github.com/eslint/eslint
76129
rev: v8.56.0
77130
hooks:
78131
- id: eslint
132+
name: ESLint
133+
description: "Check for problems in JavaScript files."
79134
exclude: |
80135
(?x)(
81136
.min(.js|.js.map)|
82137
static/(.*)/libs/
83138
)
139+
# additional_dependencies:
140+
# # eslint itself needs to be here when using additional_dependencies.
141+
# - [email protected] # https://github.com/eslint/eslint/releases/latest
142+
# - [email protected] # https://github.com/sindresorhus/globals/releases/latest
84143

85144
- repo: https://github.com/thibaudcolas/pre-commit-stylelint
86-
rev: v16.1.0
145+
rev: v16.2.1
87146
hooks:
88147
- id: stylelint
148+
name: Stylelint
149+
description: "Check for problems in CSS files."
89150
exclude: |
90151
(?x)(
91152
.min(.css|.css.map)|
@@ -95,23 +156,42 @@ repos:
95156
- --formatter=compact
96157
additional_dependencies:
97158
# stylelint itself needs to be here when using additional_dependencies.
98-
- stylelint@16.1.0 # https://github.com/stylelint/stylelint/releases/latest
159+
- stylelint@16.2.1 # https://github.com/stylelint/stylelint/releases/latest
99160
- [email protected] # https://github.com/stylelint/stylelint-config-standard/releases/latest
100161

101162
- repo: https://github.com/pre-commit/pygrep-hooks
102163
rev: v1.10.0
103164
hooks:
104165
- id: python-check-blanket-noqa # Enforce that noqa annotations always occur with specific codes. Sample annotations: # noqa: F401, # noqa: F401,W203
166+
name: Check for blanket noqa
167+
description: "Check for blanket noqa annotations."
168+
105169
- id: python-check-blanket-type-ignore # Enforce that # type: ignore annotations always occur with specific codes. Sample annotations: # type: ignore[attr-defined], # type: ignore[attr-defined, name-defined]
170+
name: Check for blanket type ignore
171+
description: "Check for blanket type ignore annotations."
172+
106173
- id: python-check-mock-methods # Prevent common mistakes of assert mck.not_called(), assert mck.called_once_with(...) and mck.assert_called
174+
name: Check for mock methods
175+
description: "Check for common mistakes of mock methods."
176+
107177
- id: python-no-eval # A quick check for the eval() built-in function
178+
name: Check for eval
179+
description: "Check for the eval() built-in function."
180+
108181
- id: python-no-log-warn # A quick check for the deprecated .warn() method of python loggers
182+
name: Check for log warn
183+
description: "Check for the deprecated .warn() method of python loggers."
184+
109185
- id: python-use-type-annotations # Enforce that python3.6+ type annotations are used instead of type comments
186+
name: Use type annotations
187+
description: "Enforce that python3.6+ type annotations are used instead of type comments."
110188

111189
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
112190
rev: 2.7.3
113191
hooks:
114192
- id: editorconfig-checker
193+
name: EditorConfig Checker
194+
description: "Check for compliance with the definitions in the EditorConfig file."
115195
exclude: |
116196
(?x)(
117197
LICENSE|
@@ -123,56 +203,74 @@ repos:
123203
rev: 1.15.0
124204
hooks:
125205
- id: django-upgrade
206+
name: Django upgrade
207+
description: "Upgrade Django code to a target version."
126208
args:
127209
- --target-version=4.0 # Minimum supported Django version for AA. Update as needed.
128210

129211
- repo: https://github.com/asottile/pyupgrade
130212
rev: v3.15.0
131213
hooks:
132214
- id: pyupgrade
215+
name: PyUpgrade
216+
description: "Upgrade syntax to newer versions of Python."
133217
args:
134-
- --py38-plus
218+
- --py38-plus # Minimum required Python version for AA. Update as needed.
135219

136220
- repo: https://github.com/pycqa/flake8
137-
rev: 6.1.0
221+
rev: 7.0.0
138222
hooks:
139223
- id: flake8
224+
name: Flake8
225+
description: "Check for style and complexity issues in Python code."
140226

141227
- repo: https://github.com/asottile/yesqa
142228
rev: v1.5.0
143229
hooks:
144230
- id: yesqa
231+
name: YesQA
232+
description: "Check for extraneous `# noqa` comments."
145233

146234
- repo: https://github.com/PyCQA/isort
147235
rev: 5.13.2
148236
hooks:
149237
- id: isort
238+
name: Isort
239+
description: "Sort imports."
150240

151241
- repo: https://github.com/Pierre-Sassoulas/black-disable-checker/
152242
rev: v1.1.3
153243
hooks:
154244
- id: black-disable-checker
245+
name: Black disable checker
246+
description: "Check for black disable comments."
155247

156248
- repo: https://github.com/psf/black
157-
rev: 23.12.1
249+
rev: 24.1.1
158250
hooks:
159251
- id: black
252+
name: Black
253+
description: "Format Python code."
160254
args:
161255
- --target-version=py38 # Minimum required Python version for AA. Update as needed.
162256

163257
- repo: https://github.com/asottile/blacken-docs
164258
rev: 1.16.0
165259
hooks:
166260
- id: blacken-docs
261+
name: Blacken docs
262+
description: "Format Python code in documentation files."
167263
additional_dependencies:
168-
- black==23.12.1 # https://github.com/psf/black/releases/latest
264+
- black==24.1.1 # https://github.com/psf/black/releases/latest
169265
args:
170266
- --target-version=py38 # Minimum required Python version for AA. Update as needed.
171267

172268
- repo: https://github.com/executablebooks/mdformat
173269
rev: 0.7.17
174270
hooks:
175271
- id: mdformat
272+
name: Mdformat
273+
description: "Format Markdown files."
176274
exclude: |
177275
(?x)(
178276
.github/
@@ -187,24 +285,32 @@ repos:
187285
rev: 1.3.1
188286
hooks:
189287
- id: tox-ini-fmt
288+
name: tox.ini formatter
289+
description: "Format the tox.ini file."
190290

191291
- repo: https://github.com/tox-dev/pyproject-fmt
192-
rev: 1.5.3
292+
rev: 1.7.0
193293
hooks:
194294
- id: pyproject-fmt
295+
name: pyproject.toml formatter
296+
description: "Format the pyproject.toml file."
195297
args:
196298
- --indent=4
197299
additional_dependencies:
198300
- tox==4.11.4 # https://github.com/tox-dev/tox/releases/latest
199301

200302
- repo: https://github.com/abravalheri/validate-pyproject
201-
rev: v0.15
303+
rev: v0.16
202304
hooks:
203305
- id: validate-pyproject
306+
name: Validate pyproject.toml
307+
description: "Validate the pyproject.toml file."
204308

205309
- repo: https://github.com/pylint-dev/pylint
206310
rev: v3.0.3
207311
hooks:
208312
- id: pylint
313+
name: Pylint
314+
description: "Check for errors and code smells in Python code."
209315
args:
210316
- --py-version=3.8 # Minimum required Python version for AA. Update as needed.

aa_intel_tool/tests/test_templatetags.py

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
Tests for the template tags
33
"""
44

5-
65
# Django
76
from django.test import TestCase
87

0 commit comments

Comments
 (0)