Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using tox to reformat the working copy #195

Merged
merged 2 commits into from
Feb 28, 2024

Conversation

masklinn
Copy link
Contributor

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.

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.
@masklinn masklinn enabled auto-merge (rebase) February 28, 2024 16:04
@masklinn masklinn merged commit 1d1abc4 into ua-parser:master Feb 28, 2024
29 checks passed
@masklinn masklinn deleted the tox-format-allow-simple branch February 28, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant