Skip to content

Releases: numtide/treefmt

v2.5.0

07 Apr 20:05
v2.5.0
7ab41ba

Choose a tag to compare

Features

  • thanks to @jfly you can now set no-positional-arg-support on a formatter to work around tools that don't accept positional file arguments #636 #679
  • upgraded to Go 1.26.1 #678

Nixpkgs Tracker

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

Bugfixes

  • fixed a context read bug in git and jujutsu walkers #678

Changelog

Full Changelog: v2.4.1...v2.5.0

v2.4.1

27 Feb 08:45
v2.4.1
b007d53

Choose a tag to compare

Bugfixes

  • we now skip git submodules, as they will have their own formatting rules #661
  • cancelling execution with ctrl-c should now be respected again when formatting large repos (e.g. nixpkgs)

Nixpkgs Tracker

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

Changelog

Full Changelog: v2.4.0...v2.4.1

v2.4.0

18 Oct 17:45
v2.4.0
c911282

Choose a tag to compare

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

21 May 12:33
v2.3.1
f24fc53

Choose a tag to compare

Bugfixes

  • automatic resolution of the tree root with git rev-parse --show-toplevel was only being applied when walk was set to git and not auto.

Nixpkgs PR Tracker

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

Changelog

v2.3.0

16 May 14:15
v2.3.0
60f791c

Choose a tag to compare

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

08 Apr 08:10
v2.2.1
9399cd6

Choose a tag to compare

Bugfixes

  • respect .gitignore when traversing untracked files in git walker.

Nixpkgs PR Tracker

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

Changelog

  • cca79a8: feat: respect .gitignore in git walker when traversing untracked files (@brianmcgee)
  • 0139d65: fix(deps): update module golang.org/x/sync to v0.13.0 (@renovate[bot])
  • a23fd4b: fix(deps): update module golang.org/x/sys to v0.32.0 (@renovate[bot])

v2.2.0

31 Mar 12:32
v2.2.0
0773976

Choose a tag to compare

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

29 Nov 13:28
v2.1.1
741970b

Choose a tag to compare

Bugfixes

  • fixes a subtle concurrency bug which can cause treefmt to not exit with an error code if a formatter fails
  • fixes emojis and other non-ASCII characters in file paths 😂

Nixpkgs PR Tracker

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

Changelog

v2.1.0

08 Nov 11:05
v2.1.0
cab1a29

Choose a tag to compare

Better configuration

We replaced kong with cobra+viper for cli processing and configuration.

This brings two new features:

  1. Option overrides with environment variables.
  2. More options can now be configured in treefmt.toml.

The order of precedence between flags, env variables, and config is now also correct.

See here for more info.

Simpler codebase

Many improvements have been made to simplify the codebase and make it easier to follow.

In addition, we no longer rely on go-git; instead, we use git itself.

We have seen some issues with go-git and decided that it wasn't adding much value and would always remain a source of discrepancy with git itself.

Better testing

Thanks to jfly and their (sometimes excruciating 😜) attention to detail, we have fixed some bugs, refined some features, and improved the quality of testing overall.

Better documentation

It might not look as pretty as before, but we moved back to mkdocs-material.

The main driver for the change was a better story around versioning, which is being provided by mike.

Nixpkgs PR Tracker

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

Changelog

v2.0.5

21 Aug 11:02
v2.0.5
9c13b18

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