Skip to content

Commit 0ea83c4

Browse files
committed
pre-commit: Bump versions, migrate to ruff
Signed-off-by: Stephen Finucane <[email protected]>
1 parent d8f3f06 commit 0ea83c4

File tree

7 files changed

+39
-55
lines changed

7 files changed

+39
-55
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
---
4-
default_language_version:
5-
# force all unspecified python hooks to run python3
6-
python: python3
74
repos:
8-
- repo: https://github.com/ambv/black
9-
rev: 23.7.0
10-
hooks:
11-
- id: black
125
- repo: https://github.com/pre-commit/pre-commit-hooks
13-
rev: v4.4.0
6+
rev: v5.0.0
147
hooks:
158
- id: trailing-whitespace
169
- id: mixed-line-ending
@@ -23,12 +16,14 @@ repos:
2316
- id: check-yaml
2417
files: .*\.(yaml|yml)$
2518
- id: check-added-large-files
26-
- repo: https://github.com/pycqa/flake8
27-
rev: 6.1.0
19+
- repo: https://github.com/astral-sh/ruff-pre-commit
20+
rev: v0.11.8
2821
hooks:
29-
- id: flake8
22+
- id: ruff
23+
args: ['--fix', '--unsafe-fixes']
24+
- id: ruff-format
3025
- repo: https://github.com/pre-commit/mirrors-mypy
31-
rev: v1.5.1
26+
rev: v1.15.0
3227
hooks:
3328
- id: mypy
3429
additional_dependencies:

pyproject.toml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
[tool.black]
1+
[tool.ruff]
22
line-length = 88
3-
target-version = ['py39']
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+
target-version = 'py39'
4+
5+
[tool.ruff.format]
6+
quote-style = "preserve"
7+
docstring-code-format = true

sphinxcontrib/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""
2-
sphinxcontrib
3-
~~~~~~~~~~~~~
2+
sphinxcontrib
3+
~~~~~~~~~~~~~
44
5-
This package is a namespace package that contains all extensions
6-
distributed in the ``sphinx-contrib`` distribution.
5+
This package is a namespace package that contains all extensions
6+
distributed in the ``sphinx-contrib`` distribution.
77
8-
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
9-
:license: BSD, see LICENSE for details.
8+
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
9+
:license: BSD, see LICENSE for details.
1010
"""
1111

1212
__import__('pkg_resources').declare_namespace(__name__)

sphinxcontrib/apidoc/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
2-
sphinxcontrib.apidoc
3-
~~~~~~~~~~~~~~~~~~~~
2+
sphinxcontrib.apidoc
3+
~~~~~~~~~~~~~~~~~~~~
44
5-
A Sphinx extension for running 'sphinx-apidoc' on each build.
5+
A Sphinx extension for running 'sphinx-apidoc' on each build.
66
7-
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
8-
:license: BSD, see LICENSE for details.
7+
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
8+
:license: BSD, see LICENSE for details.
99
"""
1010

1111
import pbr.version

sphinxcontrib/apidoc/ext.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""
2-
sphinxcontrib.apidoc.ext
3-
~~~~~~~~~~~~~~~~~~~~~~~~
2+
sphinxcontrib.apidoc.ext
3+
~~~~~~~~~~~~~~~~~~~~~~~~
44
5-
A Sphinx extension for running 'sphinx-apidoc' on each build.
5+
A Sphinx extension for running 'sphinx-apidoc' on each build.
66
7-
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
8-
:license: BSD, see LICENSE for details.
7+
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
8+
:license: BSD, see LICENSE for details.
99
"""
1010

1111
from os import path
@@ -28,9 +28,7 @@ def builder_inited(app: Sphinx) -> None:
2828
extra_args = app.config.apidoc_extra_args
2929

3030
if not module_dir:
31-
logger.warning(
32-
"No 'apidoc_module_dir' specified; skipping API doc " "generation"
33-
)
31+
logger.warning("No 'apidoc_module_dir' specified; skipping API doc generation")
3432
return
3533

3634
# if the path is relative, make it relative to the 'conf.py' directory

tests/conftest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""
2-
pytest config for sphinxcontrib/apidoc/tests
3-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
pytest config for sphinxcontrib/apidoc/tests
3+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44
5-
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
6-
:license: BSD, see LICENSE for details.
5+
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
6+
:license: BSD, see LICENSE for details.
77
"""
88

99
import os

tests/test_ext.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
test_apidoc
4-
~~~~~~~~~~~
3+
test_apidoc
4+
~~~~~~~~~~~
55
6-
Test the sphinxcontrib.apidoc module.
6+
Test the sphinxcontrib.apidoc module.
77
8-
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
9-
:license: BSD, see LICENSE for details.
8+
:copyright: Copyright 2018-present by Stephen Finucane <[email protected]>
9+
:license: BSD, see LICENSE for details.
1010
"""
1111

1212
import pytest

0 commit comments

Comments
 (0)