diff options
author | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-01-12 22:54:26 +0100 |
---|---|---|
committer | Gustaf Rydholm <gustaf.rydholm@gmail.com> | 2022-01-12 22:54:26 +0100 |
commit | 582489e557fa5398828151645ca10bdc4e4fae41 (patch) | |
tree | a5d1ac798b20a9376f595a9c3925878963d1d129 /lua/config/lsp/null-ls.lua | |
parent | c6d361d38bec220c4c1eef88f88aaf4ef95ab1d3 (diff) |
Add null-ls
Diffstat (limited to 'lua/config/lsp/null-ls.lua')
-rw-r--r-- | lua/config/lsp/null-ls.lua | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lua/config/lsp/null-ls.lua b/lua/config/lsp/null-ls.lua new file mode 100644 index 0000000..74f8a03 --- /dev/null +++ b/lua/config/lsp/null-ls.lua @@ -0,0 +1,39 @@ +-- Adds LSP diagnostics and formatting. + +local null_ls_status_ok, null_ls = pcall(require, "null-ls") +if not null_ls_status_ok then + return +end + +-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/formatting +local formatting = null_ls.builtins.formatting + +-- https://github.com/jose-elias-alvarez/null-ls.nvim/tree/main/lua/null-ls/builtins/diagnostics +local diagnostics = null_ls.builtins.diagnostics + +null_ls.setup({ + debug = false, + sources = { + diagnostics.cppcheck, + diagnostics.cspell, + diagnostics.flake8, + diagnostics.golangci_lint, + diagnostics.jsonlint, + diagnostics.luacheck, + diagnostics.shellcheck, + diagnostics.yamllint, + formatting.black.with({ extra_args = { "--fast" } }), + formatting.clang_format, + formatting.erlfmt, + formatting.fourmolu, + formatting.gofmt, + formatting.goimports, + formatting.nixfmt, + formatting.prettier.with({ extra_args = { "--no-semi", "--single-quote", "--jsx-single-quote" } }), + formatting.rustfmt, + formatting.shfmt, + formatting.sqlformat, + formatting.stylua, + formatting.terraform_fmt, + }, +}) |