aboutsummaryrefslogtreecommitdiffstats
path: root/lua/conform/formatters/phpcbf.lua
blob: 6c6027eeda1f5919f14b497405c2d687d205cfe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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 = function(self, ctx)
    return { "-q", "--stdin-path=" .. ctx.filename, "-" }
  end,
  stdin = true,
  -- 0: no errors found
  -- 1: errors found
  -- 2: fixable errors found
  -- 3: processing error
  exit_codes = { 0, 1, 2 },
}