Releases: NixOS/nixfmt
Releases · NixOS/nixfmt
Release list
v1.4.0
- Added
/*nixfmt:disable*/and/*nixfmt:enable*/comment directives to exclude regions of code from formatting: #388 - Fixed language annotations being detached from their string when comments are hoisted out of function applications: #425
- More small cleanups to our flake:
- Migrated the development setup from npins to flakes and added flake-compat: #416
nixpkgsandtreefmt-nixare now flake inputs that can "follow" downstream flake inputs.
- Improved the Neovim setup instructions in the README: #414, #415
v1.3.1
v1.3.0
- Updated our dependencies: #389
- Replaced references to
nixfmt-rfc-stylewithnixfmt: #369, #389 - Format pipe operator chains on multiple lines: #372
- Deprecated formatting stdin without a
-command line argument: #376 - Fixed idempotency regressions discovered by nixfmt-rs: #387
- Only parse the
ordefault clause when selectors are present, preventing silent discard oforused as a bare identifier. - Insert space before
.in integer/float selections to prevent1 .afrom becoming1.a(re-lexed as float). - Add leading hardspace in absorbOperation for Application, preventing
/and/*from merging into//*when a language annotation comment follows a division operator. - Language annotation after other trivia splits from string.
- Parenthesis-trailing comment idempotency in assignment right-hand-side.
let-intrailing comment idempotency.- Leading blank lines causing non-idempotent formatting.
- Only parse the
- Absorb single-line destructured params into parenthesized functions: #377
- Enforce that there are no warnings in our haskell code: #390
- Minor cleanup to our flake:
v1.2.0
- Reformat indented strings, reformatting to simple strings when appropriate: #348
- Added musl static build and nixfmt-static package: #349
- Added auto-release GitHub Actions workflow: #354
- Fixed empty lists/sets with comments idempotency: #363
- Fixed language annotations inside lists on function arguments: #355
- Fixed parser for chained prefix operators: #352
- Fixed inconsistent comment indentation in parameter lists: #346
- Fixed language annotations followed by multiple new lines: #347
- Memory optimization: don't retain thunks when appending to Trivia: #350
- Added a flake formatter (so nix fmt works): #357
- Added link to standard.md in README: #361
- Fixed typo in README for nixfmt installation: #345
v1.1.0
v1.0.1
v1.0.0
The Nix Formatting Team is happy to present the first stable release of the official Nix formatter! The basis for this milestone is RFC 166, which defined the standard for Nix formatting, established the Nix Formatting team and set the groundwork for nixfmt to become the official formatter.
Given that, this release is significantly different from the previous one:
- How Nix is formatted completely changed and is unrecognisable from previous versions, fixing many issues with the old formatting in the process. It would be pointless to try to list all the differences, just think of it as an entirely new formatting.
- This project graduated from a Serokell project to an official Nix project, with a repository under the NixOS org and a community-based Nix formatting team as maintainers.
Other than the above, there are some notable UX changes:
- Deprecate
nixfmt [dir]for recursively formatting a directory again. Please use the newpkgs.nixfmt-treewrapper instead, or https://github.com/numtide/treefmt-nix for more flexibility, see the docs for more options. - More complete usage documentation.
- A Git mergetool mode is now supported.
- CLI changes:
- In stdin-mode,
--filename <path>can now be used to specify a filename for diagnostics. - Number of indendation spaces can now be configured using
--indent <number>
- In stdin-mode,
v0.6.0
- Fix escaping of interpolations after dollar signs.
- Fix nixfmt trying to allocate temp files that aren't used.
- Don't write if files didn't change, fixing treefmt compatibility
- Nixfmt now accepts the '-' argument to read from stdin.
nixfmt [dir]now recursively formats nix files in that directory.- Float and int literal parsing now matches nix.
v0.5.0
- Add a nix flake to the nixfmt project.
- Add a --verify flag to check idempotency.
- Support nix path (./${foo}.nix) interpolations.
- Fix escaping of interpolations after single quotes.
- Fix handling of multiline strings with spaces in the last line.
Static linux binary included.