nixfmt

The official (but not yet stable) formatter for Nix code

MPL-2.0 License

Stars
603
Committers
24

Bot releases are visible (Hide)

nixfmt - v0.6.0 Latest Release

Published by infinisil 12 months ago

  • 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.
nixfmt - v0.5.0

Published by yorickvP over 2 years ago

  • 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.

nixfmt - v0.4.0

Published by mkaito over 4 years ago

  • 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.
nixfmt - v0.3.1

Published by mkaito over 4 years ago

  • 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.
nixfmt - v0.3.0

Published by Lucus16 about 5 years ago

  • 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.
nixfmt - v0.2.0

Published by Lucus16 about 5 years ago

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

Package Rankings
Top 6.74% on Proxy.golang.org