-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Always preserve expanded attribute parameters
This changes the formatting to take into account whether attribute parameters are expanded onto multiple lines already, and if so, preserves that. This is desirable because if a user writes an attribute parameter over multiple lines, there's most likely an intention to add more attributes, which would become harder when formatted. An example of this is package recipes, which usually start out with just a single attribute argument, but usually get more later. This would've been contracted onto a single line before this change: { stdenv, }: This change conforms to the standard due to this line: > The formatter may take the input formatting into account in some cases in order to preserve multi-line syntax elements (which would otherwise have been contracted by the rules).
- Loading branch information
Showing
6 changed files
with
77 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,12 @@ rec { | |
c = 2; | ||
}; | ||
n = pkgs: { }; | ||
o = { pkgs, ... }: { }; | ||
o = | ||
{ | ||
pkgs, | ||
... | ||
}: | ||
{ }; | ||
|
||
a | ||
# b | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,13 @@ let | |
inherit lib; | ||
in | ||
[ | ||
({}: null) | ||
({ | ||
}: null) | ||
({ | ||
|
||
}: null) | ||
|
||
( | ||
{ lib, }: | ||
let | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,15 @@ let | |
inherit lib; | ||
in | ||
[ | ||
({ }: null) | ||
({ }: null) | ||
( | ||
{ | ||
|
||
}: | ||
null | ||
) | ||
|
||
( | ||
{ lib }: | ||
let | ||
|
This file contains 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