From a22781e0c3b609a5f90095f388589744567476c7 Mon Sep 17 00:00:00 2001 From: Steven Arcangeli Date: Fri, 25 Aug 2023 11:56:50 -0700 Subject: fix: set a cwd for stylua --- lua/conform/formatters/stylua.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lua/conform') diff --git a/lua/conform/formatters/stylua.lua b/lua/conform/formatters/stylua.lua index f2cc412..ac482bd 100644 --- a/lua/conform/formatters/stylua.lua +++ b/lua/conform/formatters/stylua.lua @@ -1,3 +1,4 @@ +local util = require("conform.util") ---@type conform.FormatterConfig return { meta = { @@ -6,4 +7,8 @@ return { }, command = "stylua", args = { "--search-parent-directories", "--stdin-filepath", "$FILENAME", "-" }, + cwd = util.root_file({ + ".stylua.toml", + "stylua.toml", + }), } -- cgit v1.2.3-70-g09d2