mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 18:02:13 +02:00
added php related configuration for phpstan & phpcs
This commit is contained in:
@@ -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()
|
callback = function()
|
||||||
lint.try_lint()
|
lint.try_lint()
|
||||||
end,
|
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,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user