Skip to content

Commit

Permalink
feat(nvim): replace null-ls with nvim-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
massix committed Jun 14, 2024
1 parent a7669de commit 6d8c6a6
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
31 changes: 18 additions & 13 deletions nvim/lua/plugins/coding.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,27 @@ return {
},

{
"nvimtools/none-ls.nvim",
dependencies = {
"ThePrimeagen/refactoring.nvim",
},
name = "null-ls",
"ThePrimeagen/refactoring.nvim",
opts = {},
config = false,
event = "BufEnter",
},

{
"mfussenegger/nvim-lint",
opts = {},
config = function()
local nls = require("null-ls")
nls.setup({
sources = {
nls.builtins.diagnostics.cppcheck,
nls.builtins.diagnostics.fish,
nls.builtins.code_actions.refactoring,
},
require("lint").linters_by_ft = {
c = { "cppcheck" },
cpp = { "cppcheck" },
fish = { "fish" },
}

vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
require("lint").try_lint()
end,
})
end,
event = { "BufEnter", "BufWinEnter" },
},
}
6 changes: 2 additions & 4 deletions nvim/lua/plugins/lualine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ return {
local bufft = vim.api.nvim_buf_get_option(bufnr, "filetype")
local clients = {}

-- filter out null-ls
-- FIXME: rewrite this
for _, client in ipairs(vim.lsp.get_active_clients({ bufnr = bufnr })) do
if client.name ~= "null-ls" then
table.insert(clients, client)
end
table.insert(clients, client)
end

if next(clients) == nil then
Expand Down
2 changes: 2 additions & 0 deletions nvim/lua/plugins/project.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ return {
"index.org",
"compile_flags.txt",
"compile_commands.json",
"go.mod",
"go.sum",
},
show_hidden = false,
silent_chdir = true,
Expand Down
13 changes: 0 additions & 13 deletions nvim/lua/plugins/ui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,6 @@ return {
},
opts = { skip = true },
},

{
-- Skip messages from null-ls
filter = {
event = "lsp",
kind = "progress",
cond = function(message)
local client = vim.tbl_get(message.opts, "progress", "client")
return client == "null-ls"
end,
},
opts = { skip = true },
},
},
presets = {
bottom_search = true,
Expand Down

0 comments on commit 6d8c6a6

Please sign in to comment.