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
- 718fbbb: Workaround for darwin build issue (@jfly)
- b5f54fa:
path ... not inside the tree root: Show computed relative path (@9999years) - de5d307: feat(walk): add jujutsu walker (@delafthi)
- d7cb4d2: feat: add
evalConfigfrom nixpkgs (@MattSturgeon) - b68d328: feat: introduce tmp path for stdin files (@brianmcgee)
- 6cfbdf0: fix(jujutsu): remove unnecessary unquoting of file paths (@delafthi)
- 109948a: fix:
treefmt .no longer segfaults if.is root and symlink (@jfly) - 3a3b57c: fix: add jujutsu to devshell (@brianmcgee)
- 8c25148: fix: force-remove db file when clearing cache (@brianmcgee)
- 5d318c2: fix: processing stdin with a globally excluded path (@brianmcgee)
- 3750fdb: fixup! fix: cachix/install-nix-action version in gh pages workflow (@brianmcgee)
- e8274d4: refactor: simplify one line of nix code (@MattSturgeon)
v2.3.1
v2.3.0
Features
- you can now specify the tree root with a command
--tree-root-cmdorTREEFMT_TREE_ROOT_CMD. When using thegitwalker, if no other tree root has been specified, it will default togit 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
- 3c8acf4: Fix broken link (@jfly)
- a22a307: Fix when tree root is symlink (@9999years)
- b97672a: feat: find tree root via a user-specified command (@brianmcgee)
- 1c19088: fix(deps): update module github.com/charmbracelet/log to v0.4.2 (@renovate[bot])
- 11ea13e: fix(deps): update module golang.org/x/sync to v0.14.0 (@renovate[bot])
- b74fbb4: fix(deps): update module golang.org/x/sys to v0.33.0 (@renovate[bot])
v2.2.1
v2.2.0
Features
- we now traverse untracked files in the git walker.
- a new
-q|--quietflag has been added which will suppress all output except for errors. - for users who don't quiet need
treefmt-nixbut still want to configuretreefmtwith nix, there are now
treefmt.withConfigandtreefmt.buildConfighelper 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,zshandfish, 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
stderris a dumbtty.
Nixpkgs PR Tracker
https://nixpkgs-tracker.ocfox.me/?pr=394906
Changelog
- 621144f: better error if command cannot be found (@Mic92)
- 855eb9a: docs(README): update motivation (@zimbatm)
- f4336fd: feat(docs): auto-generate usage snippet (@brianmcgee)
- 583681d: feat(docs): improve docs package (@brianmcgee)
- 5861604: feat(docs): refine setup (@brianmcgee)
- 3828aaf: feat(docs): rename content directory to site (@brianmcgee)
- b0731a2: feat: add
withConfig&buildConfigfrom nixpkgs (@MattSturgeon) - 10c9a72: feat: add a quiet flag to suppress all output except for errors (@brianmcgee)
- b76d839: feat: change default log level for unmatched to INFO instead of WARN (@brianmcgee)
- 43f943f: feat: enforce formatter name format (@brianmcgee)
- 30e1ecd: feat: improve error handling in format Run method (@brianmcgee)
- d182c6d: feat: log the config file used at DEBUG level instead of INFO (@brianmcgee)
- 21cefd7: feat: print stats to stderr instead of stdout (@brianmcgee)
- 9662ee6: feat: traverse untracked files in git walker (@brianmcgee)
- d17a8d6: feat: update to go 1.24 (@brianmcgee)
- e90b952: fix(go): update termenv to v0.16.0 (@zimbatm)
- d82a9fc: fix: bad usage of require.Errorf (@brianmcgee)
- ce65379: fix: ignoring symlinks (#528) (@gabyx)
- bbf3177: fix: move path resolution logging to debug instead of error (@brianmcgee)
- 2503227: fix: shell completions (@brianmcgee)
v2.1.1
v2.1.0
v2.0.5
Bugfixes
- 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 asshellcheckorshfmtto 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
- c53a1f1: feat: log changed files at error level when --fail-on-change is enabled (@brianmcgee)
- a581352: fix: Do not exclude executables in git walker (@akshaymankar)
- 1734bcf: fix: remove assertFormatted, use assertStats instead (@brianmcgee)
Nixpkgs PR Tracker
v2.0.4
Bugfixes
- 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.
- Searching for
.treefmt.tomland relying on$PRJ_ROOThave been re-introduced for parity withv1. - 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
INFOlevel logging at a minimum - enables
--no-cacheand--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
modtime. This was causing intermittent failures in CI due to how fast agitcheckout and subsequenttreefmtinvocation were occurring.
Changelog
- 52d8c48: Update nixpkgs.toml (@mattalxndr)
- 17c1785: Update treefmt.toml (@mattalxndr)
- d4aaba9: feat: ci mode (@brianmcgee)
- 0a8ffe0: feat: move filtering of directories and symlinks into walker implementations (@brianmcgee)
- ff8b1ed: feat: refactor relative path function for filesystem walker (@brianmcgee)
- 0953dd5: feat: refactor relative path function for git walker (@brianmcgee)
- bc1ae33: feat: search for .treefmt.toml (@zimbatm)
- 43c2071: fix(cli): restore PRJ_ROOT env var (@zimbatm)
- f9bc8b0: fix(git): gracefully handle a file in the index but not in the filesystem (@brianmcgee)
- a018c29: fix: relative path resolution in filesystem walker (@brianmcgee)