Commit Graph

10 Commits

Author SHA1 Message Date
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
c7d0138a02 support formatter ordering (#20)
Allows specifying the order in which formatters are applied.

Very simple for now, adding a `Before` field to the formatted config which allows the user to say that formatter `x` needs to be applied _before_ formatted `y`.

```toml
[formatter.statix]
command = "statix"
includes = ["*.nix"]
before = "deadnix"

[formatter.deadnix]
command = "statix"
includes = ["*.nix"]
```

Signed-off-by: Brian McGee <brian@bmcgee.ie>
Reviewed-on: #20
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:46:04 +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
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
d8d666a132
feat: use exec.LookPath to find formatter executable
Signed-off-by: Brian McGee <brian@bmcgee.ie>
2024-01-02 10:36:51 +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
b6405d0714
feat: clean up and documentation 2023-12-24 11:59:05 +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
12aa9a7bef
fix: glob patterns for includes and excludes
Prefix with **/
2023-12-23 13:20:11 +00:00
6904097171
feat: initial import 2023-12-23 12:50:51 +00:00