astronvim/plugins/null-ls.lua
2023-01-14 13:02:17 +01:00

32 lines
1.2 KiB
Lua

return function(config) -- overrides `require("null-ls").setup(config)`
-- config variable is the default configuration table for the setup function call
local null_ls = require "null-ls"
-- Check supported formatters and linters
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting
-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics
config.sources = {
-- Set a formatter
null_ls.builtins.formatting.stylua,
null_ls.builtins.formatting.prettier,
null_ls.builtins.formatting.deno_fmt.with {
filetypes = { "markdown" },
},
null_ls.builtins.formatting.csharpier,
null_ls.builtins.diagnostics.sqlfluff.with {
extra_args = {
"--dialect",
"postgres",
"--config",
"/Users/kah/.config/sqlfluff/sqlc/config.toml",
}, -- change to your dialect
},
null_ls.builtins.formatting.gofumpt,
null_ls.builtins.formatting.goimports,
null_ls.builtins.formatting.goimports_reviser,
null_ls.builtins.formatting.golines,
--null_ls.builtins.formatting.pg_format,
}
return config -- return final config table
end