You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a ruff check --fix-only there is no output about what errors were fixed. This surprised me, I thought it would still print the fixed error since the documentation about --fix-only says "Like fix, but disables reporting on leftover violation. Implies fix."
Maybe supplying --show-fixes will fix it? Yes,
ruff check --fix-only --show-fixes shows the fixed errors, great!
Can we also get this info in json output format? No,
ruff check --fix-only --show-fixes --output-format json print nothing! --output-format junit has the same issue.
Ruff version: 0.7.0
The text was updated successfully, but these errors were encountered:
❯ echo "import b, a" > example.py
❯ ruff check example.py --select I
example.py:1:1: I001 [*] Import block is un-sorted or un-formatted
|
1 | / import b, a
|
= help: Organize imports
Found 1 error.
[*] 1 fixable with the `--fix` option.
❯ ruff check example.py --select I --fix-only
Fixed 1 error.
❯ echo "import b, a" > example.py
❯ ruff check example.py --select I --fix
Found 1 error (1 fixed, 0 remaining).
❯ ruff check example.py --select I --fix-only --output-format json
❯ echo "import b, a" > example.py
❯ ruff check example.py --select I --fix --output-format json
[]%
❯ echo "import b, a" > example.py
❯ ruff check example.py --select I --fix --output-format json --show-fixes
[]%
❯ echo "import b, a" > example.py
❯ ruff check example.py --select I --fix-only --show-fixes
Fixed 1 error:
- example.py:
1 × I001 (unsorted-imports)
Fixed 1 error.
I don't think this has to do with --fix-only, i.e., it applies equally to --fix. I think we should improve the JSON output here, though I don't think it should rely on the --show-fixes flag.
I suspect that Ruff throws away the diagnostics after each fix cycle. We would need to preserve them and pass them through to the json emitter. This likely requires some special casing in the CLI because we don't want to emit the diagnostics for all output formats (which makes the experience somewhat inconsistent)
When running a
ruff check --fix-only
there is no output about what errors were fixed. This surprised me, I thought it would still print the fixed error since the documentation about--fix-only
says "Like fix, but disables reporting on leftover violation. Implies fix."Maybe supplying
--show-fixes
will fix it? Yes,ruff check --fix-only --show-fixes
shows the fixed errors, great!Can we also get this info in json output format? No,
ruff check --fix-only --show-fixes --output-format json
print nothing!--output-format junit
has the same issue.Ruff version: 0.7.0
The text was updated successfully, but these errors were encountered: