Skip to content

Commit

Permalink
feat: add phpcbf (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
rawalplawit authored Oct 3, 2023
1 parent cb87cab commit db5af4b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lua/conform/formatters/phpcbf.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
local util = require("conform.util")

---@type conform.FileFormatterConfig
return {
meta = {
url = "https://phpqa.io/projects/phpcbf.html",
description = "PHP Code Beautifier and Fixer fixes violations of a defined coding standard.",
},
command = util.find_executable({
"vendor/bin/phpcbf",
}, "phpcbf"),
args = { "-q", "--stdin-path=", "$FILENAME", "-" },
stdin = true,
-- 0: no errors found
-- 1: errors found
-- 2: fixable errors found
-- 3: processing error
exit_codes = { 0, 1, 2 },
}

0 comments on commit db5af4b

Please sign in to comment.