Skip to content

Commit dc11fe1

Browse files
committed
pre-commit: Migrate to ruff
Signed-off-by: Stephen Finucane <[email protected]>
1 parent c999be2 commit dc11fe1

File tree

3 files changed

+9
-27
lines changed

3 files changed

+9
-27
lines changed

.pre-commit-config.yaml

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
# See https://pre-commit.com for more information
2-
# See https://pre-commit.com/hooks.html for more hooks
32
---
4-
default_language_version:
5-
# force all unspecified python hooks to run python3
6-
python: python3
73
repos:
8-
- repo: https://github.com/ambv/black
9-
rev: 24.10.0
10-
hooks:
11-
- id: black
124
- repo: https://github.com/pre-commit/pre-commit-hooks
135
rev: v5.0.0
146
hooks:
@@ -23,10 +15,11 @@ repos:
2315
- id: check-yaml
2416
files: .*\.(yaml|yml)$
2517
- id: check-added-large-files
26-
- repo: https://github.com/pycqa/flake8
27-
rev: 7.1.1
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: v0.8.4
2820
hooks:
29-
- id: flake8
21+
- id: ruff
22+
- id: ruff-format
3023
- repo: https://github.com/pre-commit/mirrors-mypy
3124
rev: v1.14.0
3225
hooks:

pyproject.toml

+4-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
[tool.black]
1+
[tool.ruff]
22
line-length = 88
3-
target-version = ['py37']
4-
skip-string-normalization = true
5-
exclude = '''
6-
(
7-
/(
8-
\.eggs
9-
| \.git
10-
| \.tox
11-
| \.venv
12-
| build
13-
| dist
14-
)
15-
)
16-
'''
3+
4+
[tool.ruff.format]
5+
quote-style = "preserve"

sphinx_click/ext.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def _format_arguments(ctx: click.Context) -> ty.Generator[str, None, None]:
239239

240240

241241
def _format_envvar(
242-
param: ty.Union[click.core.Option, click.Argument]
242+
param: ty.Union[click.core.Option, click.Argument],
243243
) -> ty.Generator[str, None, None]:
244244
"""Format the envvars of a `click.Option` or `click.Argument`."""
245245
yield '.. envvar:: {}'.format(param.envvar)

0 commit comments

Comments
 (0)