Commit Graph

9 Commits

Author SHA1 Message Date
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
a3ca7825a6 feat: support changing work directory (#15)
Closes #10

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

Reviewed-on: #15
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-03 15:21:45 +00:00
84629f7b94 feat: support fail on change (#16)
Closes #8

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

Reviewed-on: #16
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-03 13:10:54 +00:00
811f883a2b feat/bust-cache-validators-change (#14)
Tracks the mod time and size of a formatter's executable in bolt.

The cache is busted using the following criteria:

- a new formatter has been configured.
- an existing formatter has changed (mod time or size)
- an existing formatter has been removed from config

Also implemented better resolution of symlinks when determining a formatters executable path.

Reviewed-on: #14
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-03 08:08:57 +00:00
ada9a72a7e
feat: simplify some test code
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-01-02 14:57:21 +00:00
96b1560327 feat: support global excludes (#13)
Stacked on top of #11

Co-authored-by: Brian McGee <brian@bmcgee.ie>
Reviewed-on: #13
Co-authored-by: zimbatm <zimbatm@zimbatm.com>
Co-committed-by: zimbatm <zimbatm@zimbatm.com>
2024-01-02 12:12:47 +00:00
1019851207 chore: remove dependency on juju/errors (#11)
The package was created before Go introduced their own "errors"
package.

Trade the better juju errors semantic for a smaller dependency tree.

Reviewed-on: #11
Co-authored-by: zimbatm <zimbatm@zimbatm.com>
Co-committed-by: zimbatm <zimbatm@zimbatm.com>
2024-01-02 10:33:50 +00:00
9b84155265
feat: allow specifying formatters in cli
Closes #9
2023-12-25 12:26:18 +00:00
4c45d2aa7e feat: allow missing formatters (#6)
Closes #3

Reviewed-on: #6
Co-authored-by: Brian McGee <brian@bmcgee.ie>
Co-committed-by: Brian McGee <brian@bmcgee.ie>
2023-12-23 15:00:39 +00:00