Conversation
e82b870 to
4a94126
Compare
|
Hey @musjj, thanks a lot for implementing this :) we have CI failures. |
|
@musjj let's do something, send another PR touching docs/README.md add a new line or anything, so that you are contributor to the repo and then any other push you make to this gets automatically picker without me approving CI pipelines. This for not slowing you down. |
|
Here: #86 |
|
On you might need to run |
|
Added an issue for a Justfile #87 like we have in Den but here we should be running those ./dev apps. |
|
Awesome! CI is green, can you just update docs/ for new options and I think we are good EDIT: It is ok if you only mention the options and provide a link to the nix file defining them. Or document what each option is for, as you choose. We need documentation for feature visibility. |
|
Wonderful! thanks so much for all this, @musjj 👏 I'm merging this. |
Implement granular style formatting options, giving users the level of editorial control close to what they'd get with handwritten Nix.
This PR introduces two new styling options:
Separator between attributes:
With a standard
\n:With
\n\n:Sorting priority of attributes
This allows certain attribute names to be prioritized when they are sorted. For example, let's say we have the following list:
We want to alphabetically sort it, but we want to prioritize the following names and make sure they stay at the top:
[ "zebra" "moose" "dog" ](not all names have to be present). The rest should just be alphabetically sorted.When that rule is applied to the list, we will get:
To support these new styling options, the
nixCodefunction now accepts a list of style options, each of which will be applied to each corresponding recursive call. This gives us the ability to apply different styles on each each level of depth within an expression.The power of this feature is best seen when styling
inputsattributes, because we want to be able to apply different styles on the top-levelinputsattributes (e.g.inputs = { nixpkgs = ...; }) and the attributes inside each input (e.g.nixpkgs = { url = ...; }).These styling rules can be user-customized on the level of:
inputsattributesnixConfigattributesThe former default style is mostly preserved, with the exception of the way input schema attributes are sorted.
Fix: #80