Skip to content

jrsonnet-fmt: --use-tabs now defaults to disabled - #236

Closed
JaySon-Huang wants to merge 1 commit into
deltarocks:masterfrom
JaySon-Huang:jayson/fix_indent
Closed

JaySon-Huang wants to merge 1 commit into
deltarocks:masterfrom
JaySon-Huang:jayson/fix_indent

Conversation

@JaySon-Huang

Copy link
Copy Markdown

Problem Summary

In cmds/jrsonnet-fmt/src/main.rs, the --use-tabs flag was declared as:

/// Force hard tab for indentation
#[arg(long, default_value = "true")]
use_tabs: bool,

The help text ("Force hard tab") implies an opt-in boolean flag that is off by default, but the default_value = "true" made it always true:

  • not passing the flag ==> true
  • passing the flag ==> true
  • --use-tabs=false ==> clap error ("unexpected value")

So the formatter always emitted Tab indentation, and the --indent <N> option had no visible effect.

Fix

Remove the default_value so the flag is a plain opt-in

@JaySon-Huang JaySon-Huang changed the title fix: jrsonnet-fmt --use-tabs now defaults to disabled jrsonnet-fmt: --use-tabs now defaults to disabled Aug 10, 2026
@JaySon-Huang

Copy link
Copy Markdown
Author

/cc @CertainLach

@JaySon-Huang
JaySon-Huang deleted the jayson/fix_indent branch August 31, 2026 14:21
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