Skip to content

Releases: NixOS/nixfmt

v1.4.0

Choose a tag to compare

@github-actions github-actions released this 07 Jul 21:56
7cad866
  • 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
    • nixpkgs and treefmt-nix are now flake inputs that can "follow" downstream flake inputs.
  • Improved the Neovim setup instructions in the README: #414, #415

v1.3.1

Choose a tag to compare

@github-actions github-actions released this 01 Jun 00:29
3245f22
  • Fixed aarch64-darwin build: #409
  • Added aarch64-linux and aarch64-darwin builds to CI: #409

v1.3.0

Choose a tag to compare

@MattSturgeon MattSturgeon released this 29 May 11:04
990b62d
  • Updated our dependencies: #389
  • Replaced references to nixfmt-rfc-style with nixfmt: #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 or default clause when selectors are present, preventing silent discard of or used as a bare identifier.
    • Insert space before . in integer/float selections to prevent 1 .a from becoming 1.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-in trailing comment idempotency.
    • Leading blank lines causing non-idempotent formatting.
  • 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:
    • Dropped flake-utils dependency: #401
    • Added flake description: #404
    • Removed top-level IFD: #403

v1.2.0

Choose a tag to compare

@github-actions github-actions released this 09 Jan 09:50
ccb9453
  • 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

Choose a tag to compare

@MattSturgeon MattSturgeon released this 07 Oct 16:00
v1.1.0
81f2023
  • Added support for "language annotation" comments (e.g. /* lang */ ""), used by things like tree-sitter grammars: #343
  • Fixed a regression causing incorrect path value indentation: #342

v1.0.1

Choose a tag to compare

@jfly jfly released this 16 Sep 20:12
a49757a
  • Fix bug where --ir would overwrite the source file: #322
  • Fix pre-commit hook so it works without cabal: #311

v1.0.0

Choose a tag to compare

@infinisil infinisil released this 14 Jul 11:01
1f2589c

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:

v0.6.0

Choose a tag to compare

@infinisil infinisil released this 31 Oct 21:53
7e9e06e
  • 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

Choose a tag to compare

@yorickvP yorickvP released this 19 Mar 14:20
fa30b97
  • 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

Choose a tag to compare

@mkaito mkaito released this 10 Feb 14:37
  • 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.