This commit is contained in:
sankalp committed 2024-08-26 10:11:28 +05:45
1 parent 847238c1bc
commit 35a8122396
13 files changed
+363 -146

No files matched your search

+26 -7
View File
@@ -1,8 +1,30 @@
-- Define nvim-lint linters here
local linting_servers = {
'cpplint',
'eslint_d',
'cspell',
'ruff',
'mypy',
'trivy',
'phpcs',
'markdownlint',
}
return {
'mfussenegger/nvim-lint',
dependencies = {
'rshkarin/mason-nvim-lint',
},
event = { 'BufReadPre', 'BufNewFile' },
opts = {
linters_by_ft = {
config = function()
local lint = require('lint')
require('mason-nvim-lint').setup({
ensure_installed = linting_servers,
automatic_installation = true,
})
lint.linters_by_ft = {
lua = { 'selene' },
cpp = { 'cpplint' },
c = { 'cpplint' },
@@ -14,12 +36,9 @@ return {
markdown = { 'markdownlint' },
java = { 'trivy' },
php = { 'phpcs' },
},
},
config = function()
local lint = require('lint')
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
}
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
group = lint_augroup,
callback = function()