Better configuration
We replaced kong with cobra+viper for cli processing and configuration.
This brings two new features:
- Option overrides with environment variables.
- 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
- d7c1064: Avoid hanging: ensure we always close
f.filesCh
(@jfly) - e47674d: Clarify in the spec that the formatter MUST process the given files (@jfly)
- 962d695: ci: add mergify config (@brianmcgee)
- 94c53c5: ci: run golangci-lint as a flake check instead of github workflow (@brianmcgee)
- c131adc: feat: add connect timeout to bolt db (@brianmcgee)
- 45592a9: feat: add test helper for changing work directory (@brianmcgee)
- b834fa3: feat: best-effort application of files to formatters (@brianmcgee)
- 6bfe249: feat: bump golangci-lint version to 1.61.0 in github workflow (@brianmcgee)
- 6cadbbc: feat: create a separate docs devshell (@brianmcgee)
- b956dcd: feat: improve cache busting test (@brianmcgee)
- 9e45e55: feat: improve cache test (@brianmcgee)
- d7c39b6: feat: improve change detection (@brianmcgee)
- 9d9ea4e: feat: improve change working directory test (@brianmcgee)
- 500c356: feat: improve cpu profile test (@brianmcgee)
- 13849f2: feat: improve fail on change test (@brianmcgee)
- e32b5a2: feat: improve fail on change test (@brianmcgee)
- 782c7a0: feat: improve git test (@brianmcgee)
- 5659267: feat: improve missing formatter test (@brianmcgee)
- 57abb78: feat: improve paths handling (@brianmcgee)
- d0f5990: feat: improve prj root env test (@brianmcgee)
- 40e18a3: feat: improve specifying formatters test (@brianmcgee)
- 7a717ec: feat: improve unmatched test (@brianmcgee)
- 39774dc: feat: log treefmt command and output in tests (@brianmcgee)
- 71b262f: feat: match before checking cache (@brianmcgee)
- fc88f98: feat: more stringent golangci-lint rules (@brianmcgee)
- 21fbdc0: feat: refactor caching approach (@brianmcgee)
- ca655f5: feat: refactor processing (@brianmcgee)
- 66bdc82: feat: refine deterministic order test (@brianmcgee)
- 45ed5e8: feat: refine includes/excludes test (@brianmcgee)
- bda4138: feat: refine paths arg test (@brianmcgee)
- 41712b5: feat: refine run in subdir test (@brianmcgee)
- 9d53c96: feat: refine stdin test (@brianmcgee)
- 9fc9e67: feat: refine treefmt helper api in test (@brianmcgee)
- 9d521a9: feat: refine treefmt test helper (@brianmcgee)
- 48d4b4b: feat: remove globals from stats package (@brianmcgee)
- 202acb9: feat: remove relative path optimization in filesystem walker (@brianmcgee)
- bac4a0d: feat: replace kong with cobra/viper (@brianmcgee)
- 5d3de7c: feat: simplify .envrc (@brianmcgee)
- d195f79: feat: simplify devshell (@brianmcgee)
- 844f3fd: feat: simplify git walking (@brianmcgee)
- 93c8343: feat: simplify stats recording in filesystem reader (@brianmcgee)
- 8701a8f: feat: update flake inputs (@brianmcgee)
- 0ee561e: fix: correct handling of absolute and relative paths (@jfly)
- 4f1f3d6: fix: do not cache formatting errors (@brianmcgee)
- 6824497: fix: duplicate iota in walk.Type enum (@brianmcgee)
- 8aeee1d: fix: exit with error if any formatters fail (@brianmcgee)
- df4de90: fix: formatter_test (@brianmcgee)
- 2d3398c: fix: git module domain (@brianmcgee)
- f6d1b13: fix: golanci-lint workflow (@brianmcgee)
- 7740e3a: fix: gomod2nix.toml (@brianmcgee)
- 9ce6522: fix: normalize and enforce stdin paths as well (@jfly)
- 147dcdb: fix: path handling and checking git index (@brianmcgee)
- 5306a5e: fix: resolve commands relative to the root (@zimbatm)
- db7b305: fix: unmatched reporting global excludes (@brianmcgee)
- d490e98: fix: use PRJ_ROOT to find config (@brianmcgee)