Skip to content

Releases: numtide/treefmt

v2.0.5

21 Aug 11:02
v2.0.5
9c13b18
Compare
Choose a tag to compare

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

08 Aug 09:39
v2.0.4
31e363d
Compare
Choose a tag to compare

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

v2.0.3

08 Jul 08:20
v2.0.3
65152cb
Compare
Choose a tag to compare

Bugfixes

  1. We were trying to open a cache file when using -c --no-cache, breaking some CI workflows. This is now handled more gracefully.

  2. When comparing mod times, we used the precision the underlying file system gave us. Some formatters, such as dos2unix, manipulate the mod time, but not to the same precision. This was causing false positives when using --no-cache --fail-on-change. We now truncate the mod time to second-level precision before comparing, as POSIX specifies that mod time should be EPOCH (second) precision. This brings us back in line with v1 behaviour.

Summary Improvements

We have improved the summary statistics presented at the end of each run, clarifying what has happened and removing unnecessary precision in the elapsed time.

nix fmt 
traversed 116 files
emitted 116 files for processing
formatted 67 files (0 changed) in 696ms

Changelog

Nixpkgs PR Tracker

https://nixpk.gs/pr-tracker.html?pr=325465

v2.0.2

01 Jul 19:22
v2.0.2
33d2f60
Compare
Choose a tag to compare

Changelog

v2.0.0-rc5

17 Jun 08:17
v2.0.0-rc5
30d30b5
Compare
Choose a tag to compare

Changelog

v2.0.1

28 Jun 14:18
30d30b5
Compare
Choose a tag to compare

We have rewritten treefmt in Go but have tried to retain backward compatibility as much as possible.

For the most part, treefmt 2.0 should be a drop-in replacement for 1.0.

Users may find some behaviour differences in how treefmt 2.0 traverses the filesystem. Please review the new website treefmt.com for more info.

If you have any problems, please create an issue, and we will do our best to resolve it promptly.

For some background, you can read more here.

Features

  • migrated cache storage from Toml to boltdb
  • introduced the concept of walkers to make filesystem traversal extensible. It currently supports auto, git, and filesystem. You no longer have to exclude the .git directory; ' treefmtwill traverse files based on the git index if a.git` directory is detected.
  • we now guarantee only one formatter will operate on a given path at any time.
  • ordering for formatters can now be controlled with a new priority field.
  • improved performance by up to 8x when cached based on a nixpkgs benchmark
  • migrated docs from mkdocs to vitepress
  • docs are now hosted under a custom domain, treefmt.com

Changelog

Read more

v2.0.0-rc4

06 Jun 07:47
v2.0.0-rc4
ab2b373
Compare
Choose a tag to compare
v2.0.0-rc4 Pre-release
Pre-release

Changelog

v2.0.0-rc3

29 May 14:29
v2.0.0-rc3
0223983
Compare
Choose a tag to compare
v2.0.0-rc3 Pre-release
Pre-release

Changelog

v2.0.0-rc2

17 May 11:08
v2.0.0-rc2
a20db20
Compare
Choose a tag to compare
v2.0.0-rc2 Pre-release
Pre-release

Changelog

v2.0.0-rc1

13 May 09:49
v2.0.0-rc1
54d3cd0
Compare
Choose a tag to compare
v2.0.0-rc1 Pre-release
Pre-release

We have chosen to re-write treefmt in Go, but have tried to retain backwards compatibility as much as possible. For the most part, treefmt 2.0 should be a drop in replacement for 1.0.

Where users may find some differences in behaviour is in how treefmt 2.0 traverses the filesystem. See below for an explanation of walkers.

If you have any problems please create an issue and we will do our best to resolve it in a timely fashion.

Features

  • migrated cache storage from Toml to boltdb
  • introduced the concept of walkers to make traversal of the filesystem extensible. Currently supports auto, git and filesystem. You no longer have to exclude the .git directory, and treefmt will traverse files based on the git index if a .git directory is detected.
  • introduced the concept of pipelines to allow grouping of related formatters into a deterministic sequence
  • improved performance by up to 8x when cached based on a nixpkgs benchmark
  • migrated docs from mkdocs to vitepress
  • docs are now hosted under a custom domain, treefmt.com

Changelog

Read more