mirror of
https://github.com/numtide/treefmt.git
synced 2024-08-16 12:20:25 +03:00
feat: add an example of 'before'
Signed-off-by: Brian McGee <brian@bmcgee.ie>
This commit is contained in:
parent
f4700c4e63
commit
2b49923bf7
@ -52,13 +52,13 @@ func TestReadConfigFile(t *testing.T) {
|
|||||||
as.Equal([]string{"*.hs"}, haskell.Includes)
|
as.Equal([]string{"*.hs"}, haskell.Includes)
|
||||||
as.Equal([]string{"examples/haskell/"}, haskell.Excludes)
|
as.Equal([]string{"examples/haskell/"}, haskell.Excludes)
|
||||||
|
|
||||||
// nix
|
// alejandra
|
||||||
nix, ok := cfg.Formatters["nix"]
|
alejandra, ok := cfg.Formatters["alejandra"]
|
||||||
as.True(ok, "nix formatter not found")
|
as.True(ok, "alejandra formatter not found")
|
||||||
as.Equal("alejandra", nix.Command)
|
as.Equal("alejandra", alejandra.Command)
|
||||||
as.Nil(nix.Options)
|
as.Nil(alejandra.Options)
|
||||||
as.Equal([]string{"*.nix"}, nix.Includes)
|
as.Equal([]string{"*.nix"}, alejandra.Includes)
|
||||||
as.Equal([]string{"examples/nix/sources.nix"}, nix.Excludes)
|
as.Equal([]string{"examples/nix/sources.nix"}, alejandra.Excludes)
|
||||||
|
|
||||||
// ruby
|
// ruby
|
||||||
ruby, ok := cfg.Formatters["ruby"]
|
ruby, ok := cfg.Formatters["ruby"]
|
||||||
|
@ -12,5 +12,7 @@ with pkgs; [
|
|||||||
rustfmt
|
rustfmt
|
||||||
shellcheck
|
shellcheck
|
||||||
shfmt
|
shfmt
|
||||||
|
statix
|
||||||
|
deadnix
|
||||||
terraform
|
terraform
|
||||||
]
|
]
|
||||||
|
@ -26,11 +26,17 @@ options = [
|
|||||||
includes = ["*.hs"]
|
includes = ["*.hs"]
|
||||||
excludes = ["examples/haskell/"]
|
excludes = ["examples/haskell/"]
|
||||||
|
|
||||||
[formatter.nix]
|
[formatter.alejandra]
|
||||||
command = "alejandra"
|
command = "alejandra"
|
||||||
includes = ["*.nix"]
|
includes = ["*.nix"]
|
||||||
# Act as an example on how to exclude specific files
|
# Act as an example on how to exclude specific files
|
||||||
excludes = ["examples/nix/sources.nix"]
|
excludes = ["examples/nix/sources.nix"]
|
||||||
|
# Make this run before deadnix
|
||||||
|
# Note this formatter determines the file set for any 'downstream' formatters
|
||||||
|
before = "deadnix"
|
||||||
|
|
||||||
|
[formatter.deadnix]
|
||||||
|
command = "deadnix"
|
||||||
|
|
||||||
[formatter.ruby]
|
[formatter.ruby]
|
||||||
command = "rufo"
|
command = "rufo"
|
||||||
|
Loading…
Reference in New Issue
Block a user