Feature parity with treefmt.rs #22
@ -52,13 +52,13 @@ func TestReadConfigFile(t *testing.T) {
|
||||
as.Equal([]string{"*.hs"}, haskell.Includes)
|
||||
as.Equal([]string{"examples/haskell/"}, haskell.Excludes)
|
||||
|
||||
// nix
|
||||
nix, ok := cfg.Formatters["nix"]
|
||||
as.True(ok, "nix formatter not found")
|
||||
as.Equal("alejandra", nix.Command)
|
||||
as.Nil(nix.Options)
|
||||
as.Equal([]string{"*.nix"}, nix.Includes)
|
||||
as.Equal([]string{"examples/nix/sources.nix"}, nix.Excludes)
|
||||
// alejandra
|
||||
alejandra, ok := cfg.Formatters["alejandra"]
|
||||
as.True(ok, "alejandra formatter not found")
|
||||
as.Equal("alejandra", alejandra.Command)
|
||||
as.Nil(alejandra.Options)
|
||||
as.Equal([]string{"*.nix"}, alejandra.Includes)
|
||||
as.Equal([]string{"examples/nix/sources.nix"}, alejandra.Excludes)
|
||||
|
||||
// ruby
|
||||
ruby, ok := cfg.Formatters["ruby"]
|
||||
|
@ -12,5 +12,7 @@ with pkgs; [
|
||||
rustfmt
|
||||
shellcheck
|
||||
shfmt
|
||||
statix
|
||||
deadnix
|
||||
terraform
|
||||
]
|
||||
|
@ -26,11 +26,17 @@ options = [
|
||||
includes = ["*.hs"]
|
||||
excludes = ["examples/haskell/"]
|
||||
|
||||
[formatter.nix]
|
||||
[formatter.alejandra]
|
||||
command = "alejandra"
|
||||
includes = ["*.nix"]
|
||||
# Act as an example on how to exclude specific files
|
||||
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]
|
||||
command = "rufo"
|
||||
|
Reference in New Issue
Block a user