nixfmt
nixfmt copied to clipboard
The official (but not yet stable) formatter for Nix code
### Description It seems `==` is preferred as a break point over the logic operators `||` and `&&`. I think it should be the opposite, at least I can't think...
### Description The `\t` form of tab characters in strings are expanded to a literal tab character. The result could be confused for space characters. ### Small example input ```...
### Description Function parameter set blocks with default arguments are most clear and most pretty to read when the parameters are presented each on one line (and i tend to...
Currently, all comments are parsed after tokens, but comments generally apply to the token that follows it, with the exception of trailing comments on the same line. Many formatting cases...
### Description Horizontally aligned comments and values make blocks of code containing such things much more readable. nixfmt shouldn't force this alignment, but it should preserve it if it's there,...
[As discussed on Discourse](https://discourse.nixos.org/t/nixfmt-alpha-release/2899/19?u=infinisil), opening an issue to discuss what to do about expressions that standard Nix throws an error for, but nixfmt doesn't mind. The cases I found are:...
### Description The parser skips all leading zeroes, even when they are semantically meaningful. This leads to a semantics change. ### Small example input ``` (a: b: builtins.toJSON [a b])...
### Description The parser doesn't accept floats starting with `.` ### Small example input ``` .5e5 ``` ### Expected output ``` 0.5e5 ``` ### Actual output ``` :1:6: | 1...
I prefer to indent my Nix expressions with four spaces rather than two as I find it more readable. It'd be nice to have this as a command-line option you...