Skip to content

Commit 1f9f840

Browse files
committed
build: tooling for ruff formatting
1 parent 9ee5b3e commit 1f9f840

File tree

5 files changed

+10
-2
lines changed

5 files changed

+10
-2
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ repos:
1515
- id: trailing-whitespace
1616
exclude: "stress_phystoken|\\.py,cover$"
1717

18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: v0.12.9
20+
hooks:
21+
- id: ruff-format
22+
1823
- repo: https://github.com/pre-commit/pygrep-hooks
1924
rev: v1.10.0
2025
hooks:

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,12 @@ ghrel_template = """
156156
"""
157157

158158
## RUFF
159-
# We aren't using ruff for real yet...
159+
# We are using ruff for formatting, but not for linting.
160160

161161
[tool.ruff]
162162
# PYVERSION
163163
target-version = "py39" # Can't use [project]
164164
line-length = 100
165-
src = ["coverage", "tests"]
166165

167166
[tool.ruff.lint]
168167
select = ["ALL"]

requirements/dev.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ cogapp
1717
greenlet
1818
pylint
1919
readme_renderer
20+
ruff
2021

2122
# for kitting.
2223
libsass

requirements/dev.pip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ rfc3986==2.0.0
157157
# via twine
158158
rich==14.1.0
159159
# via twine
160+
ruff==0.12.9
161+
# via -r requirements/dev.in
160162
scriv==1.7.0
161163
# via -r requirements/dev.in
162164
setuptools==80.9.0

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ commands =
104104
# If this command fails, see the comment at the top of doc/cmd.rst
105105
python -m cogapp -cP --check --verbosity=1 doc/*.rst
106106
python -m cogapp -cP --check --verbosity=1 .github/workflows/*.yml
107+
ruff format --check
107108
python -m pylint -j 0 --notes= --ignore-paths 'doc/_build/.*' {env:LINTABLE}
108109
check-manifest --ignore 'doc/sample_html/*'
109110
# If 'build -q' becomes a thing (https://github.com/pypa/build/issues/188),

0 commit comments

Comments
 (0)