Releases · numtide/treefmt

v2.4.1

v2.4.0

Features

  • thanks to @delafthi we now support jujutsu #601 🎉
  • temporary files for processing stdin are no longer created within the tree root #624

Nixpkgs Tracker

https://nixpkgs-tracker.ocfox.me/?pr=453282

Bugfixes

  • global excludes are now handled correctly when processing stdin #641
  • no longer segfaulting if tree root is a symlink #595
  • force removal of cache db when clearing the cache #592

Changelog

v2.3.1

v2.3.0

Features

  • you can now specify the tree root with a command --tree-root-cmd or TREEFMT_TREE_ROOT_CMD. When using the git walker, if no other tree root has been specified, it will default to git rev-parse --show-toplevel. This negates the need for --tree-root-file .git/config.

Bugfixes

  • fixes handling of the tree root when it is a symlink.

Nixpkgs PR Tracker

https://nixpkgs-tracker.ocfox.me/?pr=407639

Changelog

v2.2.1

v2.2.0

Features

  • we now traverse untracked files in the git walker.
  • a new -q|--quiet flag has been added which will suppress all output except for errors.
  • for users who don't quiet need treefmt-nix but still want to configure treefmt with nix, there are now
    treefmt.withConfig and treefmt.buildConfig helper functions exposed directly from the package itself (NixOS/nixpkgs#390147).

Bugfixes

  • we now ignore symlinks when traversing.
  • static shell completions should now work for bash, zsh and fish, and can be generated with
    treefmt --completion <bash|zsh|fish>.
  • improved error reporting if a formatter command cannot be found.
  • we no longer hang for 10 seconds when stderr is a dumb tty.

Nixpkgs PR Tracker

https://nixpkgs-tracker.ocfox.me/?pr=394906

Changelog

v2.1.1

v2.1.0

v2.0.5

Bugfixes

  1. When walking the filesystem with git, we were skipping executable files. There is a test which should have detected this. In this case, the test also had a bug 🤦‍♂️ Thanks to @akshaymankar for the fix. The test has also been updated. This affects users using formatters such as shellcheck or shfmt to format their executable shell scripts.

--fail-on-change improvement

We now log the path that has changed at error level, making it easier to understand why CI builds are failing.

Changelog

Nixpkgs PR Tracker

https://nixpkgs-tracker.ocfox.me/?pr=336307

v2.0.4

Bugfixes

  1. There was a naive optimisation for resolving relative paths within the walker implementations, which manifested in a few different issues. This has been refactored with a robust implementation.
  2. Searching for .treefmt.toml and relying on $PRJ_ROOT have been re-introduced for parity with v1.
  3. We were not gracefully handling the case where a file was removed from the filesystem but not yet staged. We now log a warning and continue when this happens.

New CI flag

You can now run treefmt with a --ci flag which does the following:

  • ensures INFO level logging at a minimum
  • enables --no-cache and --fail-on-change
  • introduces a small startup delay, so we do not start processing until the second after the process starts, thereby ensuring the accuracy of our change detection based on second-level mod time. This was causing intermittent failures in CI due to how fast a git checkout and subsequent treefmt invocation were occurring.

Changelog

Nixpkgs PR Tracker

https://nixpkgs-tracker.ocfox.me/?pr=333200