aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrawalplawit <39916917+rawalplawit@users.noreply.github.com>2023-10-03 21:35:30 +0545
committerGitHub <noreply@github.com>2023-10-03 08:50:30 -0700
commitdb5af4b04e5d61236a142ab78ec3f9416aab848c (patch)
tree962311a4e89632f5d74709a8682677a1d32ede91
parentcb87cab7a6baa6192bf13123c2a5af6fd059d62c (diff)
feat: add phpcbf (#103)
-rw-r--r--lua/conform/formatters/phpcbf.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/lua/conform/formatters/phpcbf.lua b/lua/conform/formatters/phpcbf.lua
new file mode 100644
index 0000000..5d3461e
--- /dev/null
+++ b/lua/conform/formatters/phpcbf.lua
@@ -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 },
+}