-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always expand attrs #222
Always expand attrs #222
Conversation
cc0507a
to
2f67380
Compare
As a better alternative to this, I think we should finally implement input-aware formatting of lists/sets. Specifically to never contract lists/sets that are expanded onto multiple lines already. We previously added this to the standard to make that possible: Line 67 in f09ce41
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
The part of the standard you quote is taken out of context, this is a deliberate special case for bindings. IMO this sweeping approach of always expanding attributes is a net negative to the output layout, especially when attribute sets are non-last arguments to function calls. Moreover, this misses several other similar inconsistencies which happen with lists. The current rules have already been tweaked a lot, and I would strongly prefer an approach which refines them a bit more:
|
Implemented the above alternative here: #224 |
Closing in favor of the above alternative |
Note
Closed in favor of #224
This implements this part of the standard:
nixfmt/standard.md
Lines 1259 to 1267 in f09ce41
This inconsistency was noticed in NixOS/nixpkgs#326430 (comment)
Edit: Though there's also this here:
nixfmt/standard.md
Line 1149 in f09ce41