Skip to content

Releases: NixOS/nixfmt

v1.0.0

14 Jul 11:01
1f2589c
Compare
Choose a tag to compare

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 new pkgs.nixfmt-tree wrapper instead, or https://github.com/numtide/treefmt-nix for more flexibility, see the docs for more options.
  • More complete usage documentation.
  • 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>

v0.6.0

31 Oct 21:53
7e9e06e
Compare
Choose a tag to compare
  • 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

19 Mar 14:20
fa30b97
Compare
Choose a tag to compare
  • 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.

v0.4.0

10 Feb 14:37
Compare
Choose a tag to compare
  • Report non-conforming files on the same line to aid line-oriented processing.
  • Fix help, summary, and version flag contents.
  • Fix indentation of leading comments in parens.

v0.3.1

10 Feb 14:25
23b4d2e
Compare
Choose a tag to compare
  • Report non-conforming files on the same line to aid line-oriented processing.
  • Fix help, summary, and version flag contents.
  • Fix indentation of leading comments in parens.

v0.3.0

29 Aug 13:11
v0.3.0
9b17898
Compare
Choose a tag to compare
  • Added check flag for use in CI.
  • Added quiet flag to disable all output on stderr.
  • Further improved indentation.
  • Fixed bugs where Nix code with different semantics was emitted in some cases.

v0.2.0

25 Jul 20:08
e4f31f4
Compare
Choose a tag to compare

We've improved nixfmt by using atomic writes to avoid data loss, adding proper indentation and making sure nixfmt is idempotent so you won't get strange behavior when you run it again.

Please try out our formatter on your code and see if you like the result. For any parts you think are formatted unclearly, please make an issue so we can improve it.

nix-env -f https://github.com/serokell/nixfmt/archive/v0.2.0.tar.gz -i