Skip to content

Commit 717a499

Browse files
committed
Update pre-commit hooks and ruff config
Add and reorganize pre-commit hooks: include check-added-large-files, check-yaml, check-toml, name-tests-test (with --pytest-test-first), check-merge-conflict; replace setup-cfg-fmt with pyproject-fmt and add validate-pyproject. Bump astral-sh/ruff-pre-commit to v0.15.0. Uncomment and enable Ruff configuration in pyproject.toml (lint rules, fix, target-version, line-length, pydocstyle convention) and add [tool.pyproject-fmt] settings (max_supported_python=3.12, generate_python_version_classifiers=true, table_format="long") to control pyproject formatting behavior.
1 parent 23251e4 commit 717a499

File tree

2 files changed

+30
-15
lines changed

2 files changed

+30
-15
lines changed

.pre-commit-config.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,27 @@ repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
33
rev: v6.0.0
44
hooks:
5-
- id: check-docstring-first
5+
- id: check-added-large-files
6+
- id: check-yaml
7+
- id: check-toml
68
- id: end-of-file-fixer
9+
- id: name-tests-test
10+
args: [--pytest-test-first]
711
- id: trailing-whitespace
8-
- repo: https://github.com/asottile/setup-cfg-fmt
9-
rev: v3.2.0
12+
- id: check-merge-conflict
13+
- repo: https://github.com/tox-dev/pyproject-fmt
14+
rev: v2.15.2
1015
hooks:
11-
- id: setup-cfg-fmt
16+
- id: pyproject-fmt
17+
- repo: https://github.com/abravalheri/validate-pyproject
18+
rev: v0.25
19+
hooks:
20+
- id: validate-pyproject
1221
- repo: https://github.com/astral-sh/ruff-pre-commit
13-
rev: v0.14.10
22+
rev: v0.15.0
1423
hooks:
1524
# Run the formatter.
1625
- id: ruff-format
1726
# Run the linter.
1827
- id: ruff-check
19-
args: [--fix,--unsafe-fixes]
28+
args: [--fix,--unsafe-fixes]

pyproject.toml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,18 @@ include = ["dlclive*"]
9191
[tool.setuptools.package-data]
9292
dlclive = ["check_install/*"]
9393

94-
# [tool.ruff]
95-
# lint.select = ["E", "F", "B", "I", "UP"]
96-
# lint.ignore = ["E741"]
97-
# target-version = "py310"
98-
# fix = true
99-
# line-length = 120
100-
101-
# [tool.ruff.lint.pydocstyle]
102-
# convention = "google"
94+
[tool.ruff]
95+
lint.select = ["E", "F", "B", "I", "UP"]
96+
lint.ignore = ["E741"]
97+
target-version = "py310"
98+
fix = true
99+
line-length = 120
100+
101+
[tool.ruff.lint.pydocstyle]
102+
convention = "google"
103+
104+
[tool.pyproject-fmt]
105+
max_supported_python = "3.12"
106+
generate_python_version_classifiers = true
107+
# Avoid collapsing tables to field.key = value format (less readable)
108+
table_format = "long"

0 commit comments

Comments
 (0)