diff options
| author | Mike Vink <mike@pionative.com> | 2025-02-08 08:16:07 +0100 |
|---|---|---|
| committer | Mike Vink <mike@pionative.com> | 2025-02-08 08:16:07 +0100 |
| commit | 7d30d2272ef59166c1b382cab324a400a42d577d (patch) | |
| tree | 8f153f04818c7622b9cd2a3e1a18f9dcce1a1104 /.config/nvim/lua/my/packages/lint.lua | |
| parent | fd48011d2ef530b392df72e8685da4e8a2a54d1d (diff) | |
copy config
Diffstat (limited to '.config/nvim/lua/my/packages/lint.lua')
| -rw-r--r-- | .config/nvim/lua/my/packages/lint.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/.config/nvim/lua/my/packages/lint.lua b/.config/nvim/lua/my/packages/lint.lua new file mode 100644 index 0000000..815f9b3 --- /dev/null +++ b/.config/nvim/lua/my/packages/lint.lua @@ -0,0 +1,26 @@ +local lint = require("lint") +local conform = require("conform") + +function is_executable(program) + return vim.fn.executable(program) == 1 +end + +lint.linters_by_ft = { + markdown=ternary(is_executable("vale"), { "vale" }, {}), + python=ternary(is_executable("ruff"), { "ruff" }, {}), + sh={ "shellcheck" }, +} + +conform.setup { + formatters_by_ft={ + python= { "ruff_format", "isort" }, + go= { "goimports" }, + nix= { "alejandra" }, + terraform= { "terraform_fmt" }, + hcl= { "terraform_fmt" }, + }, + format_on_save={ + timeout_ms= 500, + lsp_fallback= false + } +} |
