Skip to content

Commit 1d1abc4

Browse files
committed
Allow using tox to reformat the working copy
By default, tox should check that the code is correctly formatted CI-style. However it can be useful to use it to *fix* the code as well. By using `--diff` as an overridable default, tox -eblack -- becomes an easy way to reformat the working copy. Technically it's not that much shorter than `ruff format`, but if the previous command was `tox -eblack` (to check formatting) then it becomes a smaller change, and I don't have to remember the ruff invocation.
1 parent 5595b2b commit 1d1abc4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ commands = ruff check {posargs}
3636
[testenv:black]
3737
package = skip
3838
deps = ruff
39-
commands = ruff format --diff {posargs:.}
39+
commands = ruff format {posargs:--diff}
4040

4141
[testenv:typecheck]
4242
package = skip

0 commit comments

Comments
 (0)