added php related configuration for phpstan & phpcs

This commit is contained in:
aminnairi
2023-12-04 22:24:16 +01:00
parent 019ffe4b63
commit eee82aa636
+27 -8
View File
@@ -8,14 +8,33 @@ return {
local lint = require("lint") local lint = require("lint")
vim.api.nvim_create_autocmd( vim.api.nvim_create_autocmd(
{ "TextChanged", "TextChangedI", "BufEnter", "BufReadPre", "BufWritePost", "CursorHold", "CursorHoldI" }, { { "TextChanged", "TextChangedI", "BufEnter", "BufReadPre", "BufWritePost", "CursorHold", "CursorHoldI" },
callback = function() {
lint.try_lint() callback = function()
end, lint.try_lint()
}) end,
}
)
end, end,
config = function() config = function()
local lint = require("lint") local lint = require("lint")
local phpcs = lint.linters.phpcs
local phpstan = lint.linters.phpstan
phpcs.args = {
"-q",
-- <- Add a new parameter here
"--standard=PSR12",
"--report=json",
"-",
}
phpstan.args = {
"analyze",
"--error-format=json",
"--no-progress",
"--level-max"
}
lint.linters_by_ft = { lint.linters_by_ft = {
lua = { "luacheck" }, lua = { "luacheck" },
@@ -26,11 +45,11 @@ return {
vue = { "eslint" }, vue = { "eslint" },
sh = { "shellcheck" }, sh = { "shellcheck" },
fish = { "fish" }, fish = { "fish" },
json = { "jsonlint", }, json = { "jsonlint" },
markdown = { "markdownlint" }, markdown = { "markdownlint" },
php = { "php", "phpcs", "phpstan" }, php = { "php", "phpcs", "phpstan" },
css = { "stylelint" }, css = { "stylelint" },
yaml = { "yamllint" } yaml = { "yamllint" },
} }
end end,
} }