config/nvim/lua/efm.lua (view raw)
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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
-- Python
local flake8 = {
lintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -",
lintStdin = true,
lintFormats = {"%f:%l:%c: %m"}
}
-- Javascript
local eslint = {
lintCommand = "./node_modules/.bin/eslint -f unix --stdin --stdin-filename ${INPUT}",
lintIgnoreExitCode = true,
lintStdin = true,
lintFormats = {"%f:%l:%c: %m"},
formatCommand = "./node_modules/.bin/eslint --fix-to-stdout --stdin --stdin-filename=${INPUT}",
formatStdin = true
}
-- GoLang
local golint = {
lintCommand = "golint",
lintIgnoreExitCode = true,
lintFormats = {"%f:%l:%c: %m"},
lintSource = "golint"
}
-- Setup
require"lspconfig".efm.setup {
init_options = {documentFormatting = false, codeAction = false},
filetypes = {"python", "javascript", "typescript", "go"},
settings = {
rootMarkers = {".git/"},
languages = {
python = {flake8},
javascript = {eslint},
typescript = {eslint},
go = {golint}
};
};
}
|