Skip to content

Formatter: Add --indent-width and --max-line-length args to the CLI#466

Merged
marcoroth merged 3 commits intomarcoroth:mainfrom
LucasKuhn:lucas/add-args-to-formatter-cli
Sep 16, 2025
Merged

Formatter: Add --indent-width and --max-line-length args to the CLI#466
marcoroth merged 3 commits intomarcoroth:mainfrom
LucasKuhn:lucas/add-args-to-formatter-cli

Conversation

@LucasKuhn
Copy link
Contributor

This allows calling herb-format with arguments for customizing width ( --indent-width ) and line length ( --max-line-length)

The expected behavior is to use the json config, but allowing cli args opens up to some workarounds while we don't have all integrations (eg: Zed)

Based myself on the highlighter CLI where there is a parseArguments function
- help output is handled by parse argument, exit early
- version depends on loading, still inside the run
- isCheckMode is set to true/false based on arguments
- formatter initialized with default options using resolveFormatOptions
@marcoroth marcoroth changed the title Formatter: Add args to the CLI Formatter: Add --indent-width and --max-line-length args to the CLI Sep 16, 2025
Copy link
Owner

@marcoroth marcoroth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @LucasKuhn! 🙏🏼

@marcoroth marcoroth merged commit 0982bcc into marcoroth:main Sep 16, 2025
1 check passed
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.

2 participants