aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/plugins/lint.lua
blob: e9455ade95a5b7a8b632f0e5c5f35fd77ad760c1 (plain)
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
-- Verfügbare Linter: https://github.com/mfussenegger/nvim-lint/tree/master/lua/lint/linters
--
-- Hier gehören nur Linter hinein, die kein Sprachserver ohnehin schon meldet:
-- shellcheck läuft in bashls, clang-tidy in clangd, ansible-lint in ansiblels.

local ruff = { "ruff" } -- bereits als Formatter installiert, siehe plugins/format.lua

return {
  "mfussenegger/nvim-lint",
  event = { "BufReadPre", "BufNewFile" },
  config = function()
    local lint = require("lint")

    -- ergänzt die Typprüfung von basedpyright um die Lint-Regeln (F, E, UP, B ...)
    lint.linters_by_ft = {
      python = ruff,
    }

    vim.api.nvim_create_autocmd({ "BufReadPost", "BufWritePost", "InsertLeave" }, {
      callback = function()
        lint.try_lint()
      end,
    })
  end,
}