Skip to content

Commit 82c7468

Browse files
committed
Add handy pre-commit checks
1 parent 2b24269 commit 82c7468

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.pre-commit-config.yaml

+11-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ repos:
1414
rev: 5.13.2
1515
hooks:
1616
- id: isort
17-
args: [--add-import=from __future__ import annotations]
1817

1918
- repo: https://github.com/PyCQA/flake8
2019
rev: 7.0.0
@@ -32,19 +31,28 @@ repos:
3231
rev: v4.5.0
3332
hooks:
3433
- id: check-case-conflict
35-
- id: check-executables-have-shebangs
3634
- id: check-merge-conflict
37-
- id: check-json
3835
- id: check-toml
3936
- id: check-yaml
4037
- id: debug-statements
4138
- id: end-of-file-fixer
4239
- id: trailing-whitespace
4340

41+
- repo: https://github.com/tox-dev/pyproject-fmt
42+
rev: 1.7.0
43+
hooks:
44+
- id: pyproject-fmt
45+
args: [--max-supported-python=3.13]
46+
4447
- repo: https://github.com/abravalheri/validate-pyproject
4548
rev: v0.16
4649
hooks:
4750
- id: validate-pyproject
4851

52+
- repo: meta
53+
hooks:
54+
- id: check-hooks-apply
55+
- id: check-useless-excludes
56+
4957
ci:
5058
autoupdate_schedule: quarterly

pyproject.toml

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ urls."Issue tracker" = "https://github.com/python/python-docs-theme/issues"
3636
[project.entry-points."sphinx.html_themes"]
3737
python_docs_theme = 'python_docs_theme'
3838

39-
[tool.isort]
40-
profile = "black"
41-
4239
[tool.flit.module]
4340
name = "python_docs_theme"
4441

4542
[tool.flit.sdist]
4643
include = [
4744
"python_docs_theme/",
4845
]
46+
47+
[tool.isort]
48+
add_imports = "from __future__ import annotations"
49+
profile = "black"

0 commit comments

Comments
 (0)