Replace --show-source and --no-show-source with --output_format=<full|concise>#9687
Conversation
--show-source and --no-show-source with output_format=<full|concise>--show-source and --no-show-source with --output_format=<full|concise>
|
Woo! Maybe we should merge this into |
charliermarsh
left a comment
There was a problem hiding this comment.
This is great work -- really thorough and well-done. My only concern is: should we merge with concise as the default for now, so that it's not a change in behavior and just a deprecation?
That's a good question! I thought it would be useful to solve two issues at once, but if it's too big of a change I'd be OK with splitting the changes into a separate PR. I'm curious to know your thoughts on this @zanieb. |
|
So I feel like the concern is that someone doesn't like the new output then is upset that the flag to toggle it back is deprecated? Perhaps it's just that there are too many changes in a single release? My suggestion would be to gate the default with preview if feasible e.g. if Curious for @charliermarsh's thoughts though before we go changing things. |
|
I added a new bundle of tests that ensure the deprecated options behave as expected.
I understand that concern, but doesn't That being said, I'm not against gating this behind |
49df927 to
9ba18cb
Compare
…the "text" variant, and deprecate the use of `--show-source`/`--no-show-source`, along with the respective configuration fields.
…converted to a default value
9ba18cb to
71e7408
Compare
|
Hmm yeah, introspecting a bit, I think my concern is that I wanted more user feedback before deciding that the |
|
I think we're pretty settled on wanting to move that direction as our default output because we can build a lot on top of it. |
1a6e0fe to
8ebc7c7
Compare
|
I've reverted us back to using |
charliermarsh
left a comment
There was a problem hiding this comment.
Excellent! I'm still open to changing the default in v0.2.0, but we don't have to decide that to merge this PR.
bd27bb5 to
e06a385
Compare
Fixes a regression in the ecosystem checks from #9687 which was causing them to run for multiple hours due to the size of the output. We need the concise format for comparisons. We should probably update the ecosystem checks to actually diff the full output in the future because that'd be nice.
…<full|concise>` (#9687) Fixes #7350 ## Summary * `--show-source` and `--no-show-source` are now deprecated. * `output-format` supports two new variants, `full` and `concise`. `text` is now a deprecated variant, and any use of it is treated as the default serialization format. * `--output-format` now default to `concise` * In preview mode, `--output-format` defaults to `full` * `--show-source` will still set `--output-format` to `full` if the output format is not otherwise specified. * likewise, `--no-show-source` can override an output format that was set in a file-based configuration, though it will also be overridden by `--output-format` ## Test Plan A lot of tests were updated to use `--output-format=full`. Additional tests were added to ensure the correct deprecation warnings appeared, and that deprecated options behaved as intended.
Fixes a regression in the ecosystem checks from #9687 which was causing them to run for multiple hours due to the size of the output. We need the concise format for comparisons. We should probably update the ecosystem checks to actually diff the full output in the future because that'd be nice.
…<full|concise>` (#9687) Fixes #7350 ## Summary * `--show-source` and `--no-show-source` are now deprecated. * `output-format` supports two new variants, `full` and `concise`. `text` is now a deprecated variant, and any use of it is treated as the default serialization format. * `--output-format` now default to `concise` * In preview mode, `--output-format` defaults to `full` * `--show-source` will still set `--output-format` to `full` if the output format is not otherwise specified. * likewise, `--no-show-source` can override an output format that was set in a file-based configuration, though it will also be overridden by `--output-format` ## Test Plan A lot of tests were updated to use `--output-format=full`. Additional tests were added to ensure the correct deprecation warnings appeared, and that deprecated options behaved as intended. # Conflicts: # crates/ruff/tests/integration_test.rs
Fixes a regression in the ecosystem checks from #9687 which was causing them to run for multiple hours due to the size of the output. We need the concise format for comparisons. We should probably update the ecosystem checks to actually diff the full output in the future because that'd be nice. # Conflicts: # python/ruff-ecosystem/ruff_ecosystem/projects.py
…<full|concise>` (#9687) Fixes #7350 ## Summary * `--show-source` and `--no-show-source` are now deprecated. * `output-format` supports two new variants, `full` and `concise`. `text` is now a deprecated variant, and any use of it is treated as the default serialization format. * `--output-format` now default to `concise` * In preview mode, `--output-format` defaults to `full` * `--show-source` will still set `--output-format` to `full` if the output format is not otherwise specified. * likewise, `--no-show-source` can override an output format that was set in a file-based configuration, though it will also be overridden by `--output-format` ## Test Plan A lot of tests were updated to use `--output-format=full`. Additional tests were added to ensure the correct deprecation warnings appeared, and that deprecated options behaved as intended. # Conflicts: # crates/ruff/tests/integration_test.rs
Fixes a regression in the ecosystem checks from #9687 which was causing them to run for multiple hours due to the size of the output. We need the concise format for comparisons. We should probably update the ecosystem checks to actually diff the full output in the future because that'd be nice. # Conflicts: # python/ruff-ecosystem/ruff_ecosystem/projects.py
| printer_flags, | ||
| ); | ||
|
|
||
| let preview = overrides.preview.unwrap_or_default().is_enabled(); |
There was a problem hiding this comment.
Does this respect preview = true in configuration files? I think this might only respect --preview when it's set on the command line -- is that deliberate?
There was a problem hiding this comment.
No that was not deliberate, good catch.
There was a problem hiding this comment.
No worries! Was trying to pin down the build failures on #9599 after merging in main, and spotted this :)
Related changes in Ruff: astral-sh/ruff#9687
Related changes in Ruff: astral-sh/ruff#9687
Fixes #7350
Summary
--show-sourceand--no-show-sourceare now deprecated.output-formatsupports two new variants,fullandconcise.textis now a deprecated variant, and any use of it is treated as the default serialization format.--output-formatnow default toconcise--output-formatdefaults tofull--show-sourcewill still set--output-formattofullif the output format is not otherwise specified.--no-show-sourcecan override an output format that was set in a file-based configuration, though it will also be overridden by--output-formatTest Plan
A lot of tests were updated to use
--output-format=full. Additional tests were added to ensure the correct deprecation warnings appeared, and that deprecated options behaved as intended.