v2.0.1
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 supportsauto
,git
, andfilesystem
. 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
- c07305e: cli: remove global state, init function usage (@katexochen)
- 56d8561: feat: improve unmatched logic (@brianmcgee)
- e29107d: fix: only cancel formatters on background errors (@zimbatm)
- c68261e: fix: stop hard-killing formatters (@zimbatm)
- 088479e: Update cli/cli.go (@zimbatm)
- bd32d36: cli: search for the tree root by default (@zimbatm)
- bc89625: fix TreeRootFile type (@zimbatm)
- 089eb17: fix: --stdin flag (@brianmcgee)
- 0511e9a: fixes #309 (comment) (@zimbatm)
- 7f4697f: simplify logic (@zimbatm)
- 1b517c6: feat: add --on-unmatched (@brianmcgee)
- ce14ee8: feat: simplify pipeline model (@brianmcgee)
- ff3bfaa: feat: demote some cache related logging to debug level (@brianmcgee)
- 06e4145: feat: error out when a path matches multiple formatters (@brianmcgee)
- 385fbc3: feat: improve formatter cache debug logging (@brianmcgee)
- 3c264c6: feat: log out the formatter command being applied at debug level (@brianmcgee)
- c002eca: feat: log out when a path is not matched to any formatter (@brianmcgee)
- affbb99: feat: switch back to numtide/treefmt-nix (@brianmcgee)
- 24114f5: feat: update go modules (@brianmcgee)
- f7cc274: fix wording (@fricklerhandwerk)
- 4d07521: fix: -f short flag for specifying formatters (@brianmcgee)
- 3649e47: fix: support core.untrackedCache in git (@brianmcgee)
- 2b94480: fix: use resolved executable when applying a formatter (@brianmcgee)
- 187375c: README: update link to the Rust v1 (@zimbatm)
- 400d0c7: Revert "chore: temporarily remove settings.yml workflow" (@brianmcgee)
- 8de5446: Revert "ci: add go workflow" (@brianmcgee)
- 811f883: feat/bust-cache-validators-change (#14) (@brianmcgee)
- cb9564c: feat: add -s -w build flags to reduce binary size (@brianmcgee)
- 4ffe2ca: feat: add CGO dependencies to devshell (@brianmcgee)
- 2b49923: feat: add an example of 'before' (@brianmcgee)
- a79ae95: feat: add cpu profile flag (@brianmcgee)
- ad3e661: feat: add flake compat (@brianmcgee)
- aa75d3d: feat: add initial github workflow (@brianmcgee)
- 4dd4c55: feat: add nix direnv source to .envrc (@brianmcgee)
- ebfd17b: feat: add nix github workflow (@brianmcgee)
- 6ae0e4f: feat: add pipeline priority field (@brianmcgee)
- 0c5c34d: feat: add release workflow (@brianmcgee)
- 04330a3: feat: add stats output similar to treefmt.rs (@brianmcgee)
- 12452b0: feat: align example treefmt config with flake treefmt config (@brianmcgee)
- 4c45d2a: feat: allow missing formatters (#6) (@brianmcgee)
- 9b84155: feat: allow specifying formatters in cli (@brianmcgee)
- 298e5ac: feat: change module root to git.numtide.com (@brianmcgee)
- b6405d0: feat: clean up and documentation (@brianmcgee)
- 18bdb72: feat: compare with cache before reporting a file as changed (@brianmcgee)
- 757d5e7: feat: configure a pipeline for formatting nix code (@brianmcgee)
- b8d9e2a: feat: configure numtide binary cache (@brianmcgee)
- b109358: feat: create config package (#25) (@brianmcgee)
- 40b76b7: feat: ensure deterministic application of formatters (@brianmcgee)
- c71d690: feat: have each formatter filter paths again if part of a pipeline (@brianmcgee)
- 26c2ae1: feat: hex encode db name (@brianmcgee)
- 2ad87c2: feat: implement init (@brianmcgee)
- 92321c8: feat: improve specifying formatters test (@brianmcgee)
- 53ea16a: feat: improve stats assertion feedback (@brianmcgee)
- 8af5b3c: feat: introduce concept of pipelines for better concurrency (@brianmcgee)
- 7c137bf: feat: listen for shutdown correctly (@brianmcgee)
- 2e77e12: feat: optimize git walker (@brianmcgee)
- 2eaf999: feat: refactor some config init logic into config package (@brianmcgee)
- 9b00e00: feat: set nix package version to shortRev (@brianmcgee)
- ada9a72: feat: simplify some test code (@brianmcgee)
- 8b92dca: feat: streaming processing of paths from stdin and paths argument (@brianmcgee)
- da82b80: feat: support --no-cache (@brianmcgee)
- d53f98e: feat: support --version (@brianmcgee)
- 5711cae: feat: support .gitignore files (#19) (@brianmcgee)
- a3ca782: feat: support changing work directory (#15) (@brianmcgee)
- 84629f7: feat: support fail on change (#16) (@brianmcgee)
- 96b1560: feat: support global excludes (#13) (@zimbatm)
- 0fbae06: feat: support reading paths from stdin (@brianmcgee)
- 8e23c86: feat: update flake inputs (@brianmcgee)
- 1002f05: feat: update module go version to 1.22 (@brianmcgee)
- 28ec6f8: feat: upgrade modules (@brianmcgee)
- 0c93d98: feat: use a named type for Cli options (@brianmcgee)
- d8d666a: feat: use exec.LookPath to find formatter executable (@brianmcgee)
- 80e99b6: feat: use go-git index instead of
git ls-files
(#23) (@brianmcgee) - fcce518: feat: various perf improvements (@brianmcgee)
- 6c66daf: fix: devshell commands for docs (@brianmcgee)
- 15db7f4: fix: duplicate processing in ordered formatters (#24) (@brianmcgee)
- ed10f97: fix: fmt.Errorf formats (@brianmcgee)
- 12aa9a7: fix: glob patterns for includes and excludes (@brianmcgee)
- f322e1f: fix: include correct gotools package (@brianmcgee)
- 249f807: fix: install node dependencies in devshell commands (@brianmcgee)
- 25230e2: fix: license contributors (@brianmcgee)
- 4a78a1e: fix: nix build (@brianmcgee)
- 397d051: fix: nix filter for package (@brianmcgee)
- 3000c65: fix: nix-filter config for package (@brianmcgee)
- 5a5c1ea: fix: record cache entries for files that don't match formatters (@brianmcgee)
- cb8565d: fix: reduce log verbosity (@brianmcgee)
- 710efbd: fix: remember timestamps from logging (@brianmcgee)
- 97e94ba: fix: remove -dirty suffix from revision (@brianmcgee)
- 6ec924c: fix: remove goreleaser from running on pull requests (@brianmcgee)
- 87a0be9: fix: remove md extension from LICENSE file (@brianmcgee)
- f1f56d1: fix: remove setting of cpu profile rate (@brianmcgee)
- 602751a: fix: rename treefmt.go to treefmt-go (@brianmcgee)
- 49596b8: fix: setting build Name and Version (@brianmcgee)
- ab7bf54: fix: source filter in package build (@brianmcgee)
- 55ca446: fix: stalling on large file sets (#18) (@brianmcgee)
- 0ec0c3d: fix: update filter to prevent rebuilds (@brianmcgee)
- 95bc3e8: fix: update settings.yml to point to treefmt instead of treefmt-go (@brianmcgee)
- 4a6fbf9: fix: vhs command wrapper (@brianmcgee)
- aebbcfd: nit: clean batch capacity (#17) (@zimbatm)
- c7d0138: support formatter ordering (#20) (@brianmcgee)