Conversation
Summary -- Fixes #19550, fixes #19552 (eventually) This PR copies our non-watch diagnostic rendering code into `Printer::write_continuously` in preview mode, allowing it to use whatever output format is passed in. Test Plan -- Existing tests, but I don't think we have any `watch` tests, so some manual testing as well:
--output-format in ruff watch--output-format in --watch
--output-format in --watch--output-format with --watch
|
Don't we generally mark the issue as closed even if the solution is in |
In general yes, but this felt a little different since it's basically a preview warning. |
|
Actually the warning itself probably should be updated to mention preview now, but the warning isn't being shown anyway because of #19552 🙃 |
* origin/main: Respect `--output-format` with `--watch` (#21097) [`pyflakes`] Revert to stable behavior if imports for module lie in alternate branches for `F401` (#20878) Fix finding keyword range for clause header after statement ending with semicolon (#21067) [ty] Fix bug where ty would think all types had an `__mro__` attribute (#20995) Restore `indent.py` (#21094) [`flake8-django`] Apply `DJ001` to annotated fields (#20907) Clearer error message when `line-length` goes beyond threshold (#21072) Update upload and download artifacts github actions (#21083) Update dependency mdformat-mkdocs to v4.4.2 (#21088) Update cargo-bins/cargo-binstall action to v1.15.9 (#21086) Update Rust crate clap to v4.5.50 (#21090) Update Rust crate get-size2 to v0.7.1 (#21091) Update Rust crate bstr to v1.12.1 (#21089) Add missing docstring sections to the numpy list (#20931) [`pydoclint`] Fix false positive on explicit exception re-raising (`DOC501`, `DOC502`) (#21011) [ty] Use constructor parameter types as type context (#21054)
…l-constraint-sets
* dcreager/refactor-constraint-mdtests: (60 commits)
add static_asserts
move all reveal diagnostics to separate line
add more gradual tests
better comment
restructure a bit
better names/comments
simplify before implication
two typevars!
mdformat
rename mdtest
move is_subtype_of_given into ConstraintSet
move where we grab these
add ConstraintSet.{always,never}
move range_constraint into ConstraintSet class
[ty] Rename `inner` query for better debugging experience (#21106)
[ty] Add new "constraint implication" typing relation (#21010)
[semantic error tests]: refactor semantic error tests to separate files (#20926)
Respect `--output-format` with `--watch` (#21097)
[`pyflakes`] Revert to stable behavior if imports for module lie in alternate branches for `F401` (#20878)
Fix finding keyword range for clause header after statement ending with semicolon (#21067)
...
Summary -- This PR stabilizes the changes from #21097 and closes #19552. Note that this has two effects: - the default output format in `watch` mode becomes `full` instead of `concise` - the `--output-format` flag will now be respected So the default output is now more verbose, but the old stable behavior can be retained by passing `--output-format=concise` (or any other supported format) instead. Test Plan -- Manual testing. I think we tried to set up automated tests in an earlier PR but decided they were too complex.
Summary -- This PR stabilizes the changes from #21097 and closes #19552. Note that this has two effects: - the default output format in `watch` mode becomes `full` instead of `concise` - the `--output-format` flag will now be respected So the default output is now more verbose, but the old stable behavior can be retained by passing `--output-format=concise` (or any other supported format) instead. Test Plan -- Manual testing. I think we tried to set up automated tests in an earlier PR but decided they were too complex.
Summary -- This PR stabilizes the changes from #21097 and closes #19552. Note that this has two effects: - the default output format in `--watch` mode becomes `full` instead of `concise` - the `--output-format` flag will now be respected So the default output is now more verbose, but the old stable behavior can be retained by passing `--output-format=concise` (or any other supported format) instead. Test Plan -- Manual testing. I think we tried to set up automated tests in an earlier PR but decided they were too complex. I really should have cropped these, but I'll just collapse them instead: <details><summary>Screenshots</summary> <p> ### Current output, no `--output-format` <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/a758daa8-534e-4dab-9cff-858321cede61" /> ### Current output, `--output-format=json` The same as above, the flag has no effect <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/e5b0743a-6bd5-4dec-83e0-de24e44567ca" /> ### PR branch output, no `--output-format` Default format is now `full` rather than `concise` <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/cf51947d-52e3-4420-83e7-73530557c324" /> ### PR branch output, `--output-format=json` JSON output, the flag works <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/e7127c5a-88ad-4b2a-80b4-193b63b631ee" /> </p> </details>
Summary -- This PR stabilizes the changes from #21097 and closes #19552. Note that this has two effects: - the default output format in `--watch` mode becomes `full` instead of `concise` - the `--output-format` flag will now be respected So the default output is now more verbose, but the old stable behavior can be retained by passing `--output-format=concise` (or any other supported format) instead. Test Plan -- Manual testing. I think we tried to set up automated tests in an earlier PR but decided they were too complex. I really should have cropped these, but I'll just collapse them instead: <details><summary>Screenshots</summary> <p> ### Current output, no `--output-format` <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/a758daa8-534e-4dab-9cff-858321cede61" /> ### Current output, `--output-format=json` The same as above, the flag has no effect <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/e5b0743a-6bd5-4dec-83e0-de24e44567ca" /> ### PR branch output, no `--output-format` Default format is now `full` rather than `concise` <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/cf51947d-52e3-4420-83e7-73530557c324" /> ### PR branch output, `--output-format=json` JSON output, the flag works <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/e7127c5a-88ad-4b2a-80b4-193b63b631ee" /> </p> </details>
Summary -- This PR stabilizes the changes from #21097 and closes #19552. Note that this has two effects: - the default output format in `--watch` mode becomes `full` instead of `concise` - the `--output-format` flag will now be respected So the default output is now more verbose, but the old stable behavior can be retained by passing `--output-format=concise` (or any other supported format) instead. Test Plan -- Manual testing. I think we tried to set up automated tests in an earlier PR but decided they were too complex. I really should have cropped these, but I'll just collapse them instead: <details><summary>Screenshots</summary> <p> ### Current output, no `--output-format` <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/a758daa8-534e-4dab-9cff-858321cede61" /> ### Current output, `--output-format=json` The same as above, the flag has no effect <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/e5b0743a-6bd5-4dec-83e0-de24e44567ca" /> ### PR branch output, no `--output-format` Default format is now `full` rather than `concise` <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/cf51947d-52e3-4420-83e7-73530557c324" /> ### PR branch output, `--output-format=json` JSON output, the flag works <img width="783" height="514" alt="image" src="https://github.com/user-attachments/assets/e7127c5a-88ad-4b2a-80b4-193b63b631ee" /> </p> </details>
Summary
Fixes #19550
This PR copies our non-watch diagnostic rendering code into
Printer::write_continuouslyin preview mode, allowing it to use whatever output format is passed in.I initially marked this as also fixing #19552, but I guess that's not true currently but will be true once this is stabilized and we can remove the warning.
Test Plan
Existing tests, but I don't think we have any
watchtests, so some manual testing as well. The default with justruff check --watchis stillconcise, adding just--previewstill gives thefulloutput, and then specifying any other output format works, with JSON as one example: