Skip to content

Commit b944680

Browse files
authored
chore: issue 288 (#320)
* chore: move tox configuration into tox.ini * Update style testenv to use pre-commit to run QA tests and autoformatters. * Add tool.ruff configuration to pyproject.toml. * chore: autofixed files from running new pre-commit tox env * chore: fix QA errors uncovered by new pre-commit tox env * chore: update do-lint workflow to call pre-commit env
1 parent 6e147f4 commit b944680

File tree

10 files changed

+178
-140
lines changed

10 files changed

+178
-140
lines changed

.github/workflows/do-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ jobs:
2222
with:
2323
fetch-depth: 0
2424
- name: Lint code base
25-
run: tox -e style
25+
run: tox -e pre-commit

.github/workflows/do-update-authors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ jobs:
8181
author_email: action@github.com
8282
committer_name: GitHub Actions
8383
committer_email: actions@github.com
84-
push: true
84+
push: true

.pre-commit-config.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
exclude: 'tests/'
12
repos:
23
- repo: https://github.com/pre-commit/pre-commit-hooks
34
rev: v5.0.0
@@ -25,35 +26,35 @@ repos:
2526
- id: isort
2627
args: [--settings-file, ./pyproject.toml]
2728
- repo: https://github.com/PyCQA/docformatter
28-
rev: v1.7.6
29+
rev: v1.7.7
2930
hooks:
3031
- id: docformatter
3132
additional_dependencies: [tomli]
3233
args: [--in-place, --config, ./pyproject.toml]
3334
- repo: https://github.com/charliermarsh/ruff-pre-commit
34-
rev: 'v0.11.9'
35+
rev: 'v0.12.4'
3536
hooks:
3637
- id: ruff
37-
args: [ --select, "PL", --select, "F" ]
38+
args: [ --config, ./pyproject.toml ]
3839
- repo: https://github.com/pycqa/pydocstyle
3940
rev: 6.3.0
4041
hooks:
4142
- id: pydocstyle
4243
additional_dependencies: [toml]
4344
args: [--config, ./pyproject.toml]
4445
- repo: https://github.com/pre-commit/mirrors-mypy
45-
rev: v1.15.0
46+
rev: v1.17.0
4647
hooks:
4748
- id: mypy
4849
additional_dependencies: [types-python-dateutil]
4950
args: [--config-file, ./pyproject.toml]
5051
- repo: https://github.com/myint/eradicate
51-
rev: '2.3.0'
52+
rev: '3.0.0'
5253
hooks:
5354
- id: eradicate
5455
args: []
5556
- repo: https://github.com/rstcheck/rstcheck
56-
rev: 'v6.2.4'
57+
rev: 'v6.2.5'
5758
hooks:
5859
- id: rstcheck
5960
additional_dependencies: [tomli]

CHANGELOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,3 @@ Bug Fixes
150150
## [v1.4](https://github.com/PyCQA/docformatter/tree/v1.4) (2020-12-27)
151151

152152
[Full Changelog](https://github.com/PyCQA/docformatter/compare/v1.3.1...v1.4)
153-
154-
155-

docs/source/authors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Authors
22
=======
33

4-
.. include:: ../../AUTHORS.rst
4+
.. include:: ../../AUTHORS.rst

docs/source/license.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
License
22
=======
33

4-
.. literalinclude:: ../../LICENSE
4+
.. literalinclude:: ../../LICENSE

pyproject.toml

Lines changed: 48 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -178,114 +178,58 @@ line_length = 88
178178
report = "warning"
179179
ignore_directives = [
180180
"automodule",
181+
"literalinclude",
181182
"tabularcolumns",
182183
"toctree",
183184
]
185+
ignore_messages = [
186+
"Possible title underline"
187+
]
184188
ignore_roles = [
185189
"numref",
190+
"ref",
186191
]
187192

188-
[tool.tox]
189-
legacy_tox_ini = """
190-
[tox]
191-
envlist =
192-
py39
193-
py310
194-
py311
195-
py312
196-
py313
197-
pypy3
198-
coverage
199-
style
200-
isolated_build = true
201-
skip_missing_interpreters = true
202-
skipsdist = true
203-
204-
[gh-actions]
205-
python =
206-
3.9: py39
207-
3.10: py310
208-
3.11: py311
209-
3.12: py312
210-
3.13: py313
211-
pypy-3.9: pypy3
212-
213-
[testenv]
214-
description = run the test suite using pytest under {basepython}
215-
deps =
216-
charset_normalizer
217-
coverage[toml]
218-
mock
219-
pytest
220-
pytest-cov
221-
pytest-order
222-
tomli
223-
untokenize
224-
setenv =
225-
COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
226-
commands =
227-
pip install -U pip
228-
pip install --prefix={toxworkdir}/{envname} -e .[tomli]
229-
pytest -s -x -c {toxinidir}/pyproject.toml \
230-
-m unit \
231-
--cache-clear \
232-
--cov=docformatter \
233-
--cov-config={toxinidir}/pyproject.toml \
234-
--cov-branch \
235-
{toxinidir}/tests/
236-
pytest -s -x -c {toxinidir}/pyproject.toml \
237-
-m integration \
238-
--cache-clear \
239-
--cov=docformatter \
240-
--cov-config={toxinidir}/pyproject.toml \
241-
--cov-branch \
242-
{toxinidir}/tests/
243-
pytest -s -x -c {toxinidir}/pyproject.toml \
244-
-m system \
245-
--cache-clear \
246-
--cov=docformatter \
247-
--cov-config={toxinidir}/pyproject.toml \
248-
--cov-branch \
249-
--cov-append \
250-
{toxinidir}/tests/
251-
252-
[testenv:coverage]
253-
description = combine coverage data and create report
254-
setenv =
255-
COVERAGE_FILE = {toxworkdir}/.coverage
256-
skip_install = true
257-
deps =
258-
coverage[toml]
259-
parallel_show_output = true
260-
commands =
261-
coverage combine
262-
coverage report -m
263-
coverage xml -o {toxworkdir}/coverage.xml
264-
depends = py39, py310, py311, py312, py313, pypy3
265-
266-
[testenv:style]
267-
description = run autoformatters and style checkers
268-
deps =
269-
charset_normalizer
270-
pycodestyle
271-
pydocstyle
272-
ruff==0.0.269
273-
rstcheck
274-
toml
275-
untokenize
276-
commands =
277-
pip install -U pip
278-
pip install .
279-
docformatter --black --recursive {toxinidir}/src/docformatter
280-
pycodestyle --exclude=.git,.tox,*.pyc,*.pyo,build,dist,*.egg-info,config,docs,locale,tests,tools --ignore=C326,C330,E121,E123,E126,E133,E203,E242,E265,E402,W503,W504 --format=pylint --max-line-length=88 {toxinidir}/src/docformatter
281-
pydocstyle {toxinidir}/src/docformatter
282-
ruff check --select "PL" --select "F" {toxinidir}/src/docformatter
283-
rstcheck --report-level=1 {toxinidir}/README.rst
284-
285-
[testenv:docs]
286-
description = build docformatter documentation
287-
allowlist_externals = make
288-
changedir = docs
289-
commands =
290-
make html
291-
"""
193+
[tool.ruff]
194+
exclude = [
195+
".bzr",
196+
".direnv",
197+
".eggs",
198+
".git",
199+
".git-rewrite",
200+
".hg",
201+
".ipynb_checkpoints",
202+
".mypy_cache",
203+
".nox",
204+
".pants.d",
205+
".pyenv",
206+
".pytest_cache",
207+
".pytype",
208+
".ruff_cache",
209+
".svn",
210+
".tox",
211+
".venv",
212+
".vscode",
213+
"__pypackages__",
214+
"_build",
215+
"buck-out",
216+
"build",
217+
"dist",
218+
"node_modules",
219+
"site-packages",
220+
"venv",
221+
"tests/",
222+
]
223+
line-length = 88
224+
indent-width = 4
225+
target-version = "py39"
226+
227+
[tool.ruff.lint]
228+
select = ["E", "F", "PL"]
229+
ignore = []
230+
231+
[tool.ruff.format]
232+
quote-style = "double"
233+
indent-style = "space"
234+
skip-magic-trailing-comma = false
235+
line-ending = "auto"

0 commit comments

Comments
 (0)