nvim/lua/plugins/nvim-lint.lua

42 lines
1.2 KiB
Lua
Raw Normal View History

2023-02-12 17:26:24 +00:00
return {
init = function()
require('lint').linters_by_ft = {
--python = {
2023-02-23 20:49:48 +00:00
--'ruff',
2023-02-12 17:26:24 +00:00
--'flake8',
--'pylint',
--'pycodestyle',
--'pydocstyle'
--},
2023-02-23 20:49:48 +00:00
php = { 'phpcs', },
2023-02-12 17:26:24 +00:00
markdown = { 'markdownlint' }
}
--local pydocstyle = require('lint.linters.pydocstyle')
--pydocstyle.args = {
--'--ignore=D100,D203,D213', -- disable missing module docstring info
---- disable one line before class docstring required
---- disable multiline docstring summary
---- should start at the second line
--}
--local pylint = require('lint.linters.pylint')
--pylint.args = {
--'-f',
--'json',
--'--disable=C0114', -- disable missing module docstring info
--}
2023-02-23 20:49:48 +00:00
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
2024-08-20 09:29:14 +00:00
callback = function()
require("lint").try_lint()
end,
2023-02-23 20:49:48 +00:00
})
2023-02-12 17:26:24 +00:00
vim.api.nvim_create_autocmd({ "BufEnter" }, {
callback = function()
require("lint").try_lint()
end,
})
end
}