nvim/lua/my-lint.lua

32 lines
880 B
Lua
Raw Normal View History

require('lint').linters_by_ft = {
2022-11-02 12:04:31 +00:00
python = { 'flake8', 'pylint', 'pycodestyle', 'pydocstyle'},
php = { 'phpcs' },
markdown = { 'markdownlint' }
}
2022-11-02 12:04:31 +00:00
local pydocstyle = require('lint.linters.pydocstyle')
pydocstyle.args = {
'--ignore=D100', -- disable missing module docstring info
'--ignore=D203', -- disable one line before class docstring required
'--ignore=D213', -- disable multiline docstring summary
-- should start at the second line
2022-11-02 12:04:31 +00:00
}
local pylint = require('lint.linters.pylint')
pylint.args = {
'-f',
'json',
'--disable=C0114', -- disable missing module docstring info
}
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
callback = function()
require("lint").try_lint()
end,
})
vim.api.nvim_create_autocmd({ "BufEnter" }, {
callback = function()
require("lint").try_lint()
end,
})