mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 14:32:13 +02:00
added php related configuration for phpstan & phpcs
This commit is contained in:
@@ -8,14 +8,33 @@ return {
|
||||
local lint = require("lint")
|
||||
|
||||
vim.api.nvim_create_autocmd(
|
||||
{ "TextChanged", "TextChangedI", "BufEnter", "BufReadPre", "BufWritePost", "CursorHold", "CursorHoldI" }, {
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
})
|
||||
{ "TextChanged", "TextChangedI", "BufEnter", "BufReadPre", "BufWritePost", "CursorHold", "CursorHoldI" },
|
||||
{
|
||||
callback = function()
|
||||
lint.try_lint()
|
||||
end,
|
||||
}
|
||||
)
|
||||
end,
|
||||
config = function()
|
||||
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 = {
|
||||
lua = { "luacheck" },
|
||||
@@ -26,11 +45,11 @@ return {
|
||||
vue = { "eslint" },
|
||||
sh = { "shellcheck" },
|
||||
fish = { "fish" },
|
||||
json = { "jsonlint", },
|
||||
json = { "jsonlint" },
|
||||
markdown = { "markdownlint" },
|
||||
php = { "php", "phpcs", "phpstan" },
|
||||
css = { "stylelint" },
|
||||
yaml = { "yamllint" }
|
||||
yaml = { "yamllint" },
|
||||
}
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user