summaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/phpcbf.lua
diff options
context:
space:
mode:
authorSteven Arcangeli <506791+stevearc@users.noreply.github.com>2024-03-15 08:57:34 -0700
committerGitHub <noreply@github.com>2024-03-15 08:57:34 -0700
commit67ee2258e08ccb91345d52f62484b657feccef25 (patch)
tree7cd1a7667c36ba2dc8952d4c015c98341a247b87 /lua/conform/formatters/phpcbf.lua
parentb05962622d3eebeefe6b1a90deb9eb86947e0349 (diff)
fix(phpcbf): use non-stdin formatting and customize tempfile name (#333)
prev-branch: stevearc-tmpfile-1
Diffstat (limited to 'lua/conform/formatters/phpcbf.lua')
-rw-r--r--lua/conform/formatters/phpcbf.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/lua/conform/formatters/phpcbf.lua b/lua/conform/formatters/phpcbf.lua
index 6c6027e..7f81b8b 100644
--- a/lua/conform/formatters/phpcbf.lua
+++ b/lua/conform/formatters/phpcbf.lua
@@ -9,10 +9,10 @@ return {
command = util.find_executable({
"vendor/bin/phpcbf",
}, "phpcbf"),
- args = function(self, ctx)
- return { "-q", "--stdin-path=" .. ctx.filename, "-" }
- end,
- stdin = true,
+ args = { "$FILENAME" },
+ stdin = false,
+ -- phpcbf ignores hidden files, so we have to override the default here
+ tmpfile_format = "conform.$RANDOM.$FILENAME",
-- 0: no errors found
-- 1: errors found
-- 2: fixable errors found