From eee82aa636012616279697bb405113afa597e7cd Mon Sep 17 00:00:00 2001 From: aminnairi <18418459+aminnairi@users.noreply.github.com> Date: Mon, 4 Dec 2023 22:24:16 +0100 Subject: [PATCH] added php related configuration for phpstan & phpcs --- nvim/lua/settings/lazy/plugins/nvim-lint.lua | 35 +++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/nvim/lua/settings/lazy/plugins/nvim-lint.lua b/nvim/lua/settings/lazy/plugins/nvim-lint.lua index 26a201b..b0c1f63 100644 --- a/nvim/lua/settings/lazy/plugins/nvim-lint.lua +++ b/nvim/lua/settings/lazy/plugins/nvim-lint.lua @@ -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, }