-
Notifications
You must be signed in to change notification settings - Fork 1
/
.nvim.lua
96 lines (91 loc) · 4.46 KB
/
.nvim.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
-- vim: foldmethod=marker:foldlevel=0:
local status_ok, null_ls = pcall(require, "null-ls")
if not status_ok then return end
local formatting = null_ls.builtins.formatting
local diagnostics = null_ls.builtins.diagnostics
local code_actions = null_ls.builtins.code_actions
local tools_to_run = {}
local astrocore = require "astrocore"
-- if vim.fn.executable "beautysh" == 1 then astrocore.list_insert_unique(tools_to_run, { formatting.beautysh }) end
-- if vim.fn.executable "biome" == 1 then astrocore.list_insert_unique(tools_to_run, { formatting.biome }) end
-- if vim.fn.executable "cpplint" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.cpplint }) end
-- if vim.fn.executable "cspell" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.cspell }) end
-- if vim.fn.executable "shellcheck" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.shellcheck }) end
-- if vim.fn.executable "ruff" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.ruff }) end
if vim.fn.executable "alex" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.alex }) end
if vim.fn.executable "checkmake" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.checkmake }) end
if vim.fn.executable "codespell" == 1 then
astrocore.list_insert_unique(tools_to_run, { diagnostics.codespell, formatting.codespell })
end
if vim.fn.executable "gitlint" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.gitlint }) end
if vim.fn.executable "markdownlint-cli2" == 1 then
astrocore.list_insert_unique(tools_to_run, { diagnostics.markdownlint_cli2 })
end
if vim.fn.executable "mdformat" == 1 then astrocore.list_insert_unique(tools_to_run, { formatting.mdformat }) end
if vim.fn.executable "proselint" == 1 then astrocore.list_insert_unique(tools_to_run, { code_actions.proselint }) end
if vim.fn.executable "selene" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.selene }) end
if vim.fn.executable "shellharden" == 1 then astrocore.list_insert_unique(tools_to_run, { formatting.shellharden }) end
if vim.fn.executable "shfmt" == 1 then astrocore.list_insert_unique(tools_to_run, { formatting.shfmt }) end
if vim.fn.executable "stylua" == 1 then astrocore.list_insert_unique(tools_to_run, { formatting.stylua }) end
if vim.fn.executable "textlint" == 1 then astrocore.list_insert_unique(tools_to_run, { diagnostics.textlint }) end
if vim.fn.executable "yamlfix" == 1 then astrocore.list_insert_unique(tools_to_run, { formatting.yamlfix }) end
null_ls.register(tools_to_run)
-- Other project-specific 'diagnostic-linters' and 'formatters' to consider {{{
-- code_actions.cspell, -- https://github.com/davidmh/cspell.nvim
-- diagnostics.actionlint,
-- diagnostics.ansiblelint,
-- diagnostics.checkmake,
-- diagnostics.chktex,
-- diagnostics.cppcheck,
-- diagnostics.cspell, -- https://github.com/davidmh/cspell.nvim
-- diagnostics.editorconfig_checker,
-- diagnostics.flake8,
-- diagnostics.hadolint,
-- diagnostics.jsonlint,
-- diagnostics.ltrs,
-- diagnostics.markdownlint,
-- diagnostics.misspell,
-- diagnostics.mlint,
-- diagnostics.mypy,
-- diagnostics.proselint,
-- diagnostics.pydocstyle.with { extra_args = { "--config=$ROOT/setup.cfg" } },
-- diagnostics.pylama,
-- diagnostics.pylint,
-- diagnostics.pyproject_flake8,
-- diagnostics.revive.with { method = null_ls.methods.DIAGNOSTICS_ON_SAVE },
-- diagnostics.rstcheck,
-- diagnostics.shellcheck.with { diagnostics_format = "[#{c}] #{m} (#{s})" },
-- diagnostics.sqlfluff,
-- diagnostics.staticcheck.with { method = null_ls.methods.DIAGNOSTICS_ON_SAVE },
-- diagnostics.stylint,
-- diagnostics.vale,
-- diagnostics.vint,
-- diagnostics.vulture,
-- diagnostics.write_good,
-- diagnostics.yamllint,
-- formatting.asmformat,
-- formatting.bibclean,
-- formatting.brittany,
-- formatting.cbfmt,
-- formatting.clang_format,
-- formatting.cmake_format,
-- formatting.fixjson,
-- formatting.format_r, -- needs the 'R' command to be in $PATH
-- formatting.fprettify,
-- formatting.goformat,
-- formatting.goimports,
-- formatting.latexindent,
-- formatting.markdownlint,
-- formatting.perltidy,
-- formatting.reorder_python_imports,
-- formatting.rustfmt,
-- formatting.shfmt.with { extra_args = { "-i", "2", "-ci" } },
-- formatting.sqlfluff,
-- formatting.standardrb,
-- formatting.styler, -- needs the 'R' command to be in $PATH
-- formatting.taplo,
-- formatting.textlint,
-- null_ls.builtins.code_actions.gitrebase,
-- null_ls.builtins.code_actions.shellcheck,
-- null_ls.builtins.hover.dictionary,
-- }}}