add black and lint

This commit is contained in:
2025-07-16 23:13:25 +02:00
parent 0df503d095
commit acf897fb5c
3 changed files with 35 additions and 0 deletions

8
lua/plugins/conform.lua Normal file
View File

@@ -0,0 +1,8 @@
return {
"stevearc/conform.nvim",
opts = {
formatters_by_ft = {
python = { "black" },
},
},
}

26
lua/plugins/nvim-lint.lua Normal file
View File

@@ -0,0 +1,26 @@
return {
{
"mfussenegger/nvim-lint",
event = { "BufReadPre", "BufNewFile" },
config = function()
local lint = require("lint")
-- Linter pro Dateityp konfigurieren
lint.linters_by_ft = {
python = { "pylint" },
}
-- Standardmäßig beim Speichern linten
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
lint.try_lint()
end,
})
-- Optional: Mapping für manuelles Linting
vim.keymap.set("n", "<leader>ll", function()
lint.try_lint()
end, { desc = "Lint current file" })
end,
},
}