Releases: numtide/treefmt
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 asshellcheck
orshfmt
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
- 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.toml
and relying on$PRJ_ROOT
have 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
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 agit
checkout and subsequenttreefmt
invocation 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)
Nixpkgs PR Tracker
v2.0.3
Bugfixes
-
We were trying to open a cache file when using
-c --no-cache
, breaking some CI workflows. This is now handled more gracefully. -
When comparing
mod
times, we used the precision the underlying file system gave us. Some formatters, such asdos2unix
, manipulate themod
time, but not to the same precision. This was causing false positives when using--no-cache --fail-on-change
. We now truncate themod
time to second-level precision before comparing, as POSIX specifies thatmod
time should be EPOCH (second) precision. This brings us back in line withv1
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
- a642145: feat: display elapsed time to nearest millisecond (@brianmcgee)
- f266fc8: feat: if we can't open the cache, fallback to no cache (@brianmcgee)
- da7b015: feat: improve summary stats (@brianmcgee)
- 33a7bba: fix: --no-cache (@brianmcgee)
- 85ce0a2: fix: use second precision when comparing file mod times (@brianmcgee)
Nixpkgs PR Tracker
v2.0.2
Changelog
- 7d7815e: doc: fix global excludes config example (@brianmcgee)
- aea75cd: feat: remove CGO dependencies and disable (@brianmcgee)
- 986f020: feat: use numtide/blueprint instead of flake.parts (@brianmcgee)
- 2e05603: fix: configure toml tags for config fields (@brianmcgee)
- 601af09: fix: only try opening the cache if cache is enabled (@flokli)
v2.0.0-rc5
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)
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 ...
v2.0.0-rc4
v2.0.0-rc3
Changelog
- 1b517c6: feat: add --on-unmatched (@brianmcgee)
- ce14ee8: feat: simplify pipeline model (@brianmcgee)
v2.0.0-rc2
Changelog
- 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)
v2.0.0-rc1
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 supportsauto
,git
andfilesystem
. You no longer have to exclude the.git
directory, andtreefmt
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
- 4f004de: Merge branch 'main' into dependabot/github_actions/actions/setup-go-5 (@mergify[bot])
- 87e844a: Merge branch 'main' into dependabot/github_actions/goreleaser/goreleaser-action-5 (@mergify[bot])
- 9328b46: Merge pull request #1 from numtide/feat/improve-stdin-and-path-processing (@brianmcgee)
- 3d165d7: Merge pull request #10 from numtide/fix/race-condition (@brianmcgee)
- 243d1be: Merge pull request #2 from numtide/feat/cpu-profiling (@brianmcgee)
- 3ed9fc9: Merge pull request #287 from numtide/dependabot/pip/test/examples/python/flask-2.2.5 (@brianmcgee)
- 3e73f5d: Merge pull request #288 from numtide/dependabot/github_actions/goreleaser/goreleaser-action-5 (@mergify[bot])
- 010a6cf: Merge pull request #289 from numtide/dependabot/github_actions/actions/setup-go-5 (@mergify[bot])
- b7458e6: Merge pull request #3 from numtide/fix/ci-deploy-pages-on-main (@brianmcgee)
- 306fe0f: Merge pull request #4 from numtide/dependabot/github_actions/cachix/install-nix-action-26 (@brianmcgee)
- 7aa2ad6: Merge pull request #5 from numtide/feat/nix-ci (@brianmcgee)
- fe1fad5: Merge pull request #6 from numtide/feat/release-workflow (@brianmcgee)
- 0dd4344: Merge pull request #7 from numtide/feat/improve-docs (@brianmcgee)
- 2188358: Merge pull request #8 from numtide/chore/set-package-version (@brianmcgee)
- 39b73b8: Merge pull request #9 from numtide/fix/install-docs-dependencies (@brianmcgee)
- 9de4fd4: Merge pull request 'Feature parity with treefmt.rs' (#22) from feat/explicit-paths-and-stdin into main ( <>)
- 8333c99: Merge pull request 'Implement Init and fix setting build variables' (#26) from feat/init into main ( <>)
- 964330f: Merge pull request 'Port README' (#35) from feat/port-readme into main ( <>)
- 618f6f7: Merge pull request 'Stats output similar to treefmt.rs' (#33) from feat/stats into main ( <>)
- d3cdb69: Merge pull request 'feat/configure-treefmt-pipeline' (#32) from feat/configure-treefmt-pipeline into main ( <>)
- 5d341f9: Merge pull request 'feat: introduce concept of pipelines for better concurrency' (#30) from feat/concurrency-refactor into main ( <>)
- 404b0a9: Merge pull request 'improve caching and tracking' (#34) from feat/improve-caching into main ( <>)
- 2ad2cef: Merge pull request 'port docs' (#31) from feat/docs into main ( <>)
- 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)
- 8df73f7: chore(deps): bump actions/setup-go from 4 to 5 (@dependabot[bot])
- 4b47097: chore(deps): bump cachix/install-nix-action from 25 to 26 (@dependabot[bot])
- 039888b: chore(deps): bump flask from 0.12.1 to 2.2.5 in /test/examples/python (@dependabot[bot])
- feaf2b7: chore(deps): bump goreleaser/goreleaser-action from 4 to 5 (@dependabot[bot])
- 978eb48: ci: add go workflow (@brianmcgee)
- e5a6cc6: ci: handle releases with goreleaser (@zimbatm)
- 73a224a: ci: only deploy github pages on main (@brianmcgee)
- 183fbf7: ci: remove henri (@brianmcgee)
- e232ffe: ci: testing alternative gh pages upload action (@brianmcgee)
- 9cc0ab7: ci: testing alternative gh pages workflow (@brianmcgee)
- e6fe431: ci: tweak repo settings (@brianmcgee)
- ead81a6: ci: update gh pages action in github workflow (@brianmcgee)
- aa07c0a: doc: add favicon (@brianmcgee)
- fc8d8f3: doc: add footer (@brianmcgee)
- b01ea77: doc: add init gif (@brianmcgee)
- 95c6cdb: doc: add some devshell helpers (@brianmcgee)
- c68ef40: doc: adjust formatting in README (@brianmcgee)
- 926c1b2: doc: change project url to github.com/numtide/treefmt.go (@brianmcgee)
- b86d0f8: doc: configure hero and logo (@brianmcgee)
- e7f6bfa: doc: explain re-write in Go (@brianmcgee)
- e252f6b: doc: fix bad formatter spec link (@brianmcgee)
- b11474c: doc: fix copyright notice (@brianmcgee)
- 311e46a: doc: fix docs package build (@brianmcgee)
- 54d3cd0: doc: fix license link in footer (@brianmcgee)
- aa2b9e8: doc: fix social links (@brianmcgee)
- 17f354b: doc: improve hero gif (@brianmcgee)
- ea6fe2d: doc: improve treefmt.gif (@brianmcgee)
- f5c81e6: doc: initial port of README (@brianmcgee)
- 361c5a9: doc: minor tweak to README (@brianmcgee)
- 894f90f: doc: move assets into public folder (@brianmcgee)
- 7372273: doc: port existing content (@brianmcgee)
- 0a2a823: doc: reduce use of anchors for Rust and Go in README (@brianmcgee)
- 4d60509: doc: refine contributing (@brianmcgee)
- e5da10e: doc: refine docs and usage (@brianmcgee)
- 6070b6f: doc: refine faq (@brianmcgee)
- d9ee97a: doc: refine formatter spec (@brianmcgee)
- 8e840a9: doc: refine installation (@brianmcgee)
- 2f557e3: doc: refine overview (@brianmcgee)
- 577c608: doc: refine quick start content (@brianmcgee)
- f1c80ed: doc: refine usage (@brianmcgee)
- 097b701: doc: remove features on home page (@brianmcgee)
- 7806581: doc: set base url to work in github pages (@brianmcgee)
- 07989c7: doc: some initial experiments with colors (@brianmcgee)
- c815a21: doc: switch to treefmt.com domain (@brianmcgee)
- 92f8d58: doc: update fmt.gif (@brianmcgee)
- 482e497: doc: update github link (@brianmcgee)
- f4700c4: doc: update licence copyright year (@brianmcgee)
- 8323ca3: doc: update rust version link in readme (@brianmcgee)
- 352dfff: doc: update stats in overview (@brianmcgee)
- e3fabb1: doc: update usage with info about walkers. (@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 git...