Skip to content

Commit 95891fa

Browse files
committed
Add option for unsafe formatting in tox
`tox -e format-unsafe` allows to format unsafe that fixes more linter errors but might alter code logic.
1 parent 7367676 commit 95891fa

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tox.ini

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,21 @@ commands =
6767
-i "{toxinidir}/docs/src/examples" \
6868
{[tox]lint_folders} "{toxinidir}/README.rst"
6969

70-
[testenv:format]
71-
# Abuse tox to do actual formatting. Users can call `tox -e format` to run
72-
# formatting on all files
70+
[testenv:{format,format-unsafe}]
71+
description =
72+
format: Formats files in working directory.
73+
format-unsafe: Formats files in working directory. Fixes more linter errors
74+
but might alter code logic. Result of this formatting should
75+
be double checked.
7376
skip_install = true
7477
deps =
7578
ruff
7679
black
7780
blackdoc
7881
isort
7982
commands =
80-
ruff check --fix {[tox]lint_folders}
83+
format: ruff check --fix {[tox]lint_folders}
84+
format-unsafe: ruff check --fix --unsafe-fixes {[tox]lint_folders}
8185
black {[tox]lint_folders}
8286
blackdoc {[tox]lint_folders}
8387
isort {[tox]lint_folders}

0 commit comments

Comments
 (0)