Commit Graph

9 Commits

Author SHA1 Message Date
cb9564c7ef
feat: add -s -w build flags to reduce binary size
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-02-14 15:10:20 +00:00
15db7f459c fix: duplicate processing in ordered formatters (#24)
Fixes a bug with formatters processing paths out of order.

Signed-off-by: Brian McGee <brian@bmcgee.ie>

Reviewed-on: #24
Co-authored-by: Brian McGee <brian@bmcgee.ie>
Co-committed-by: Brian McGee <brian@bmcgee.ie>
2024-01-12 15:15:51 +00:00
80e99b6d75 feat: use go-git index instead of git ls-files (#23)
Figured out how to use `go-git` properly.

```console
# git

❯ nix run .# -- --config-file ./test/echo.toml --tree-root /home/brian/Development/com/github/nixos/nixpkgs -c
38539 files changed in 272.843495ms

# filesystem

❯ nix run .# -- --config-file ./test/echo.toml --tree-root /home/brian/Development/com/github/nixos/nixpkgs -c --walk filesystem
38567 files changed in 348.84277ms
```

Signed-off-by: Brian McGee <brian@bmcgee.ie>
Reviewed-on: #23
Reviewed-by: Jonas Chevalier <zimbatm@noreply.git.numtide.com>
Co-authored-by: Brian McGee <brian@bmcgee.ie>
Co-committed-by: Brian McGee <brian@bmcgee.ie>
2024-01-12 11:33:14 +00:00
5711caebb9 feat: support .gitignore files (#19)
Introduces a `--walk` flag which can be used to tell `treefmt` how to traverse the directory specified by `--tree-root`.

By default, it will attempt to use `git ls-files`. If this fails, it falls back to using the filesystem.

You can explicitly traverse the filesystem instead of using git by providing `--walk filesystem`.

Close #1

Reviewed-on: #19
Reviewed-by: Jonas Chevalier <zimbatm@noreply.git.numtide.com>
Co-authored-by: Brian McGee <brian@bmcgee.ie>
Co-committed-by: Brian McGee <brian@bmcgee.ie>
2024-01-11 20:52:22 +00:00
4a78a1e319
fix: nix build
- update `gomod2nix.toml`
- add formatters as `nativeBuildInputs` for nix build
- export a `XDG_CACHE_HOME` for checks

Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-01-03 09:20:32 +00:00
f322e1ffb8
fix: include correct gotools package 2023-12-24 11:19:48 +00:00
298e5ac217
feat: change module root to git.numtide.com 2023-12-23 13:39:16 +00:00
12452b01b6
feat: align example treefmt config with flake treefmt config
Prevent unnecessary reformatting
2023-12-23 13:06:50 +00:00
6904097171
feat: initial import 2023-12-23 12:50:51 +00:00