Skip to content

Commit 3bd9996

Browse files
authored
fix(treefmt): require config file (#777)
Running `treefmt` when no config file exists just results in an error, so checking for the presence of a config file by default makes sense. This will allow `treefmt` to be included as a formatter that should be run on all file types, without throwing errors for projects that have no treefmt config file.
1 parent e6f20ac commit 3bd9996

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lua/conform/formatters/treefmt.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ return {
66
},
77
command = "treefmt",
88
args = { "--stdin", "$FILENAME" },
9+
require_cwd = true,
10+
cwd = require("conform.util").root_file({ "treefmt.toml", ".treefmt.toml" }),
911
}

0 commit comments

Comments
 (0)