From c3a1743cd846e2edf8bf4dbe4847cc383ece74c4 Mon Sep 17 00:00:00 2001 From: Joshua Tye <21010072+catgoose@users.noreply.github.com> Date: Fri, 12 Apr 2024 05:07:46 -0500 Subject: [PATCH 1/4] ref: check for linter in unknown_linters --- lua/mason-nvim-lint/auto_install.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/mason-nvim-lint/auto_install.lua b/lua/mason-nvim-lint/auto_install.lua index 90ad56b..f5da4ca 100644 --- a/lua/mason-nvim-lint/auto_install.lua +++ b/lua/mason-nvim-lint/auto_install.lua @@ -13,7 +13,9 @@ local function auto_install() if mason_linter_identifier then require "mason-nvim-lint.install".try_install(mason_linter_identifier) else - table.insert(unknown_linters, linter_name) + if not vim.tbl_contains(unknown_linters, linter_name) then + table.insert(unknown_linters, linter_name) + end end end end From 3b2d5aac7852a420641aece02d9d0fe3baf7dded Mon Sep 17 00:00:00 2001 From: Joshua Tye <21010072+catgoose@users.noreply.github.com> Date: Fri, 12 Apr 2024 05:15:54 -0500 Subject: [PATCH 2/4] ref: check if linter is being installed already --- lua/mason-nvim-lint/auto_install.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/mason-nvim-lint/auto_install.lua b/lua/mason-nvim-lint/auto_install.lua index f5da4ca..31c86fc 100644 --- a/lua/mason-nvim-lint/auto_install.lua +++ b/lua/mason-nvim-lint/auto_install.lua @@ -6,12 +6,16 @@ local settings = require "mason-nvim-lint.settings" --@return unknown_linters string[] local function auto_install() local unknown_linters = {} + local installing_linters = {} for _, linter_names in pairs(nvim_lint.linters_by_ft) do for _, linter_name in ipairs(linter_names) do local mason_linter_identifier = mapping.nvimlint_to_package[linter_name] if mason_linter_identifier then - require "mason-nvim-lint.install".try_install(mason_linter_identifier) + if not vim.tbl_contains(installing_linters, mason_linter_identifier) then + table.insert(installing_linters, mason_linter_identifier) + require "mason-nvim-lint.install".try_install(mason_linter_identifier) + end else if not vim.tbl_contains(unknown_linters, linter_name) then table.insert(unknown_linters, linter_name) From dd21adeb69282ab9a0938371e9e4b7f24e6b18a9 Mon Sep 17 00:00:00 2001 From: Joshua Tye <21010072+catgoose@users.noreply.github.com> Date: Fri, 12 Apr 2024 05:25:43 -0500 Subject: [PATCH 3/4] ref: adds missing linters --- lua/mason-nvim-lint/mapping.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/mason-nvim-lint/mapping.lua b/lua/mason-nvim-lint/mapping.lua index 80fd052..c6c7b62 100644 --- a/lua/mason-nvim-lint/mapping.lua +++ b/lua/mason-nvim-lint/mapping.lua @@ -7,6 +7,7 @@ M.nvimlint_to_package = { ["ansible_lint"] = "ansible_lint", ["buf_lint"] = "buf", ["buildifier"] = "buildifier", + ["cbfmt"] = "cbfmt", ["cfn_lint"] = "cfn-lint", ["checkstyle"] = "checkstyle", ["clj_kondo"] = "clj-kondo", @@ -16,6 +17,7 @@ M.nvimlint_to_package = { ["cspell"] = "cspell", ["curlylint"] = "curlylint", ["djlint"] = "djlint", + ["editorconfig-checker"] = "editorconfig-checker", ["erb_lint"] = "erb-lint", ["eslint_d"] = "eslint_d", ["flake8"] = "flake8", @@ -39,16 +41,18 @@ M.nvimlint_to_package = { ["ruff"] = "ruff", ["selene"] = "selene", ["shellcheck"] = "shellcheck", + ["shellharden"] = "shellharden", + ["solhint"] = "solhint", ["sqlfluff"] = "sqlfluff", ["standardrb"] = "standardrb", ["stylelint"] = "stylelint", - ["solhint"] = "solhint", ["tflint"] = "tflint", ["tfsec"] = "tfsec", ["trivy"] = "trivy", ["vale"] = "vale", ["vint"] = "vint", ["vulture"] = "vulture", + ["write-good"] = "write-good", ["yamllint"] = "yamllint", } From de4fc36910f7cc4ad497c347725bfff9b7bedf91 Mon Sep 17 00:00:00 2001 From: Joshua Tye <21010072+catgoose@users.noreply.github.com> Date: Fri, 12 Apr 2024 05:26:06 -0500 Subject: [PATCH 4/4] ref: adds type annotation for quiet_mode --- lua/mason-nvim-lint/settings.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/mason-nvim-lint/settings.lua b/lua/mason-nvim-lint/settings.lua index 22b2360..a1a4294 100644 --- a/lua/mason-nvim-lint/settings.lua +++ b/lua/mason-nvim-lint/settings.lua @@ -15,6 +15,7 @@ local DEFAULT_SETTINGS = { automatic_installation = true, -- Disables warning notifications about misconfigurations such as invalid linter entries and incorrect plugin load order. + ---@type boolean quiet_mode = false, }