Add --no-format flag to nickel convert#2529
Merged
L0r3m1p5um merged 1 commit intonickel-lang:masterfrom Mar 3, 2026
Merged
Conversation
Add a --no-formatting flag to the convert command that skips the auto-formatting step on the converted output. This is useful for batch conversions or cases where formatted output isn't needed. - Add no_formatting bool field to ConvertCommand with clap #[arg(long)] - Skip the format::format() call when the flag is set - Add snapshot tests for --no-formatting covering all input formats - Document the flag in the user manual Closes nickel-lang#2504
ae7e4f3 to
a61503b
Compare
This was referenced Feb 28, 2026
Collaborator
|
Hello, and thanks for your contribution! I think you didn't properly added the inputs for the snapshot tests, or maybe I'm missing something? |
Collaborator
|
I think it's using the same inputs as the |
yannham
approved these changes
Mar 2, 2026
Collaborator
yannham
left a comment
There was a problem hiding this comment.
Ah, indeed. Thanks for the contribution, LGTM!
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2504
Adds a
--no-formatflag tonickel convertthat skips the auto-formatting step. This is useful for batch conversions or cases where formatted output isn't needed.Changes
--no-formatboolean flag toConvertCommand(clap#[arg(long)])--no-formatcovering all input formats (JSON, YAML, TOML, text, Nickel, unknown extension)Test plan
cargo test -p nickel-clipasses (all existing + new snapshot tests)nickel convert --no-formatproduces unformatted output[1, 2]formatted vs[ 1, 2 ]unformatted)