summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/custom/plugins/nvim-lint.lua
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-20 19:57:28 +0200
committerKyren223 <Kyren223@proton.me>2024-11-20 19:57:28 +0200
commit8ec18a224fa7a9a2a7f3233c0b0be43917e9eed6 (patch)
tree8972e3b101166557efba8db4542a9243c22b037f /.config/nvim/lua/custom/plugins/nvim-lint.lua
parentb882df090f6223940b118c2369e19d1b8a0721a4 (diff)
Added back most of the LSPs
Diffstat (limited to '.config/nvim/lua/custom/plugins/nvim-lint.lua')
-rw-r--r--.config/nvim/lua/custom/plugins/nvim-lint.lua78
1 files changed, 39 insertions, 39 deletions
diff --git a/.config/nvim/lua/custom/plugins/nvim-lint.lua b/.config/nvim/lua/custom/plugins/nvim-lint.lua
index b9b0316..7bb3a16 100644
--- a/.config/nvim/lua/custom/plugins/nvim-lint.lua
+++ b/.config/nvim/lua/custom/plugins/nvim-lint.lua
@@ -1,41 +1,41 @@
return {
- -- 'mfussenegger/nvim-lint',
- -- lazy = false,
- -- config = function()
- -- local lint = require('lint')
- -- lint.linters_by_ft = {
- -- c = { 'clangtidy' },
- -- cpp = { 'clangtidy' },
- -- go = { 'golangcilint' },
- -- python = { 'flake8' },
- -- json = { 'jsonlint' },
- -- bash = { 'shellcheck' },
- -- }
- --
- -- vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave', 'TextChanged', 'TextChangedI' }, {
- -- group = vim.api.nvim_create_augroup('nvim-lint', { clear = true }),
- -- callback = function()
- -- require('lint').try_lint()
- -- end,
- -- })
- --
- -- -- NOTE: most if not all of clangt-idy warnings are
- -- -- also reported by clangd, so this function filters clang-tidy warnings
- -- -- to avoid duplication of warnings
- -- local clangtidy_parser = lint.linters.clangtidy.parser
- -- lint.linters.clangtidy.parser = function(output, bufnr, linter_cwd)
- -- local diagnostics = clangtidy_parser(output, bufnr, linter_cwd)
- -- diagnostics = vim.tbl_filter(function(diagnostic)
- -- if diagnostic.severity == vim.diagnostic.severity.WARN then
- -- return false
- -- end
- -- if diagnostic.severity == vim.diagnostic.severity.ERROR then
- -- return false
- -- end
- --
- -- return true
- -- end, diagnostics)
- -- return diagnostics
- -- end
- -- end,
+ 'mfussenegger/nvim-lint',
+ lazy = false,
+ config = function()
+ local lint = require('lint')
+ lint.linters_by_ft = {
+ -- c = { 'clangtidy' },
+ -- cpp = { 'clangtidy' },
+ go = { 'golangcilint' },
+ -- python = { 'flake8' },
+ json = { 'jsonlint' },
+ bash = { 'shellcheck' },
+ }
+
+ vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave', 'TextChanged', 'TextChangedI' }, {
+ group = vim.api.nvim_create_augroup('nvim-lint', { clear = true }),
+ callback = function()
+ require('lint').try_lint()
+ end,
+ })
+
+ -- NOTE: most if not all of clangt-idy warnings are
+ -- also reported by clangd, so this function filters clang-tidy warnings
+ -- to avoid duplication of warnings
+ -- local clangtidy_parser = lint.linters.clangtidy.parser
+ -- lint.linters.clangtidy.parser = function(output, bufnr, linter_cwd)
+ -- local diagnostics = clangtidy_parser(output, bufnr, linter_cwd)
+ -- diagnostics = vim.tbl_filter(function(diagnostic)
+ -- if diagnostic.severity == vim.diagnostic.severity.WARN then
+ -- return false
+ -- end
+ -- if diagnostic.severity == vim.diagnostic.severity.ERROR then
+ -- return false
+ -- end
+ --
+ -- return true
+ -- end, diagnostics)
+ -- return diagnostics
+ -- end
+ end,
}