adding null_ls to fill the gap of linters that don't have LSPs

This commit is contained in:
JesseBot 2023-08-08 17:37:25 +02:00
parent aef212aded
commit 4be9a4d4f0
5 changed files with 42 additions and 1 deletions

View file

@ -49,6 +49,9 @@ require("user.toggleterm")
-- Language Server configs and other syntax checking and highlight tools
require('user.lsp-configs')
-- Language server configs for stuff that doesn't have it
require('user.null_ls')
-- autocommand to disable lsp semantic highlighting for parameter/variable in
-- Dockerfile because it competes with treesitter and is worse
vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, {

View file

@ -0,0 +1,8 @@
-- https://github.com/nvimdev/guard.nvim
{
cmd = "hadolint",
args = "",
fname = "Dockerfile",
stdin = true,
timeout = "30", --integer
}

View file

@ -320,6 +320,15 @@ local plugins = {
cmd = "TSUpdateSync",
build = "MasonUpdate" -- :MasonUpdate updates registry contents
},
-- this helps bridge the gap between additional linters that don't have proper LSP
{
'jose-elias-alvarez/null-ls.nvim'
},
-- may replace null-ls since it is being deprecated
--{
-- 'nvimdev/guard.nvim'
--},
-- Diagnostics with leader key + d
{
"folke/trouble.nvim",

View file

@ -34,7 +34,6 @@ lspconfig.dockerls.setup{
capabilities = capabilities
}
-- helm
local configs = require('lspconfig.configs')
local util = require('lspconfig.util')

View file

@ -0,0 +1,22 @@
-- TODO: replace null_ls because it's being archived, see:
-- https://github.com/jose-elias-alvarez/null-ls.nvim/issues/1621
local null_ls = require("null-ls")
null_ls.setup({
sources = {
-- linting for Dockerfile best practices
null_ls.builtins.diagnostics.hadolint,
-- markdown linting for actual language
null_ls.builtins.diagnostics.vale.with {
filetypes = {
'asciidoc',
'markdown',
'tex',
'text',
},
},
-- this should lint github actions
null_ls.builtins.diagnostics.actionlint
}
})