Our community needs a blessed and universal code formatter for the Nix code. It’s important because it removes any argument about formatting. Code becomes more uniform which makes it easier to read and skip around. Editors can now format the code on save. Copy-and-pasting code is now much easier.
Life is short and I don’t want to spend another minute of my life indenting code again.
- implement (or re-use) a comment-preserving Nix parser in the language of your choice
- collect code samples
- discuss with the community on the desired indentation of these samples
- make sure that the output is stable (running
nix fmttwice should give the same output)
- the program should be a single binary that can be copied around
In the end we want this tool to be accepted by the community and run on
nixpkgs by ofborg. It needs to run fast so it can be called by the Editor on save.
And here are some anti-goals:
- create a perfect diamond made of types (sorry Haskell). I care that it works and is fast.
- have configuration options for the formatted output. It’s very tempting and has to be resisted at any cost.
For this to work, I am looking for somebody who is already comfortable with their target language. Ideally it’s a domain you already thought about and maybe even already started implementing something.
PM me and we can discuss more of the details.
FAQ updates from PM
- Is it going to be open source? : YES please
- What type of engagement is it? : Freelance / consulting. We can discuss if other options are needed.