Skip to content

Conversation

@shimeoki
Copy link

nixfmt 1.0.0 added an --indent=INT option to configure indentation width. this PR adds this option to nixfmt-rfc-style settings to avoid using args = [ "--indent=X" ].

aside from that, i didn't like how options were handled previously, so i refactored it a bit. if this is too much (because the solution is a bit hacky and it's still not DRY), only the first commit with the feature itself without any refactoring is available - i can do a force push to it.

also, the indent option description should probably be "Indentation width.". noticed that only while writing the PR description.

@sandydoo sandydoo added the enhancement New feature or request label Sep 17, 2025
@sandydoo
Copy link
Member

nixpkgs 25.11 is going to ship nixfmt 1.0, making nixfmt-rfc-style obsolete. I've updated the nixfmt hook on master to prepare for this.

If we want to ship this option, it needs to be added to hooks.nixfmt as well. There also needs to be a version check when using the option to keep it backwards compatible with 25.05.

Don't worry to much about making it pretty or trying to dedupe the code. This will be taken care of in the module transition.
For the arguments, you can use mkCmdArgs to avoid writing a custom one-off helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants