2024-02-10 14:29:01 +00:00
|
|
|
local none_ls = require("null-ls")
|
2023-10-14 11:56:59 +00:00
|
|
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/formatting
|
2024-02-10 14:29:01 +00:00
|
|
|
local formatting = none_ls.builtins.formatting
|
2023-10-14 11:56:59 +00:00
|
|
|
-- https://github.com/nvimtools/none-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
|
2024-02-10 14:29:01 +00:00
|
|
|
local diagnostics = none_ls.builtins.diagnostics
|
2022-10-01 11:46:18 +00:00
|
|
|
|
2023-02-25 19:36:46 +00:00
|
|
|
local revive_conf = vim.fn.findfile(os.getenv("HOME") .. "/.revive.toml")
|
|
|
|
local revive_args = { "-formatter", "json", "./..." }
|
|
|
|
if revive_conf then
|
|
|
|
revive_args = { "-formatter", "json", "-config", revive_conf, "./..." }
|
|
|
|
end
|
|
|
|
|
2024-02-10 14:29:01 +00:00
|
|
|
none_ls.setup({
|
2022-10-01 11:46:18 +00:00
|
|
|
debug = false,
|
|
|
|
sources = {
|
2023-02-25 19:36:46 +00:00
|
|
|
formatting.black.with({
|
2024-03-08 18:16:23 +00:00
|
|
|
extra_args = { "--fast", "--line-length", "100" },
|
2023-02-25 19:36:46 +00:00
|
|
|
}),
|
2022-10-01 11:46:18 +00:00
|
|
|
formatting.stylua,
|
2022-11-17 18:58:39 +00:00
|
|
|
formatting.prettier,
|
2022-10-01 11:46:18 +00:00
|
|
|
diagnostics.hadolint,
|
2022-10-12 14:02:54 +00:00
|
|
|
diagnostics.markdownlint,
|
2023-02-25 19:36:46 +00:00
|
|
|
diagnostics.revive.with({
|
|
|
|
args = revive_args,
|
|
|
|
}),
|
2023-07-19 15:57:14 +00:00
|
|
|
diagnostics.cfn_lint,
|
2022-10-01 11:46:18 +00:00
|
|
|
},
|
|
|
|
})
|