Skip to content

Commit

Permalink
pre-commit: Migrate to ruff
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <stephen@that.guru>
  • Loading branch information
stephenfin committed Dec 28, 2024
1 parent c999be2 commit dc11fe1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 27 deletions.
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
---
default_language_version:
# force all unspecified python hooks to run python3
python: python3
repos:
- repo: https://github.com/ambv/black
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
Expand All @@ -23,10 +15,11 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- id: check-added-large-files
- repo: https://github.com/pycqa/flake8
rev: 7.1.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
- id: flake8
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.0
hooks:
Expand Down
19 changes: 4 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
[tool.black]
[tool.ruff]
line-length = 88
target-version = ['py37']
skip-string-normalization = true
exclude = '''
(
/(
\.eggs
| \.git
| \.tox
| \.venv
| build
| dist
)
)
'''

[tool.ruff.format]
quote-style = "preserve"
2 changes: 1 addition & 1 deletion sphinx_click/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def _format_arguments(ctx: click.Context) -> ty.Generator[str, None, None]:


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

0 comments on commit dc11fe1

Please sign in to comment.