diff options
Diffstat (limited to 'lua/lang')
| -rw-r--r-- | lua/lang/clang.lua | 10 | ||||
| -rw-r--r-- | lua/lang/go.lua | 9 | ||||
| -rw-r--r-- | lua/lang/html.lua | 13 | ||||
| -rw-r--r-- | lua/lang/lua.lua | 6 | ||||
| -rw-r--r-- | lua/lang/python.lua | 41 | ||||
| -rw-r--r-- | lua/lang/ruby.lua | 6 | ||||
| -rw-r--r-- | lua/lang/sh.lua | 32 | ||||
| -rw-r--r-- | lua/lang/tex.lua | 6 | ||||
| -rw-r--r-- | lua/lang/vim.lua | 9 | 
9 files changed, 53 insertions, 79 deletions
| diff --git a/lua/lang/clang.lua b/lua/lang/clang.lua index 59f6deca..22fd0ed0 100644 --- a/lua/lang/clang.lua +++ b/lua/lang/clang.lua @@ -14,6 +14,10 @@ M.config = function()        exe = "clang-format",        args = {},      }, +    linters = { +      "cppcheck", +      "clangtidy", +    },      debug = {        adapter = {          command = "/usr/bin/lldb-vscode", @@ -45,8 +49,10 @@ M.format = function()  end  M.lint = function() -  -- TODO: implement linters (if applicable) -  return "No linters configured!" +  require("lint").linters_by_ft = { +    c = O.lang.clang.linters, +    cpp = O.lang.clang.linters, +  }  end  M.lsp = function() diff --git a/lua/lang/go.lua b/lua/lang/go.lua index 7997a911..4174629a 100644 --- a/lua/lang/go.lua +++ b/lua/lang/go.lua @@ -6,6 +6,10 @@ M.config = function()        exe = "gofmt",        args = {},      }, +    linters = { +      "golangcilint", +      "revive", +    },    }  end @@ -27,8 +31,9 @@ M.format = function()  end  M.lint = function() -  -- TODO: implement linters (if applicable) -  return "No linters configured!" +  require("lint").linters_by_ft = { +    go = O.lang.go.linters, +  }  end  M.lsp = function() diff --git a/lua/lang/html.lua b/lua/lang/html.lua index 5f91becf..1c45cd05 100644 --- a/lua/lang/html.lua +++ b/lua/lang/html.lua @@ -1,7 +1,13 @@  local M = {}  M.config = function() -  O.lang.html = {} +  O.lang.html = { +    linters = { +      "tidy", +      -- https://docs.errata.ai/vale/scoping#html +      "vale", +    }, +  }  end  M.format = function() @@ -10,8 +16,9 @@ M.format = function()  end  M.lint = function() -  -- TODO: implement linters (if applicable) -  return "No linters configured!" +  require("lint").linters_by_ft = { +    html = O.lang.html.linters, +  }  end  M.lsp = function() diff --git a/lua/lang/lua.lua b/lua/lang/lua.lua index 39fde833..f14b0b1d 100644 --- a/lua/lang/lua.lua +++ b/lua/lang/lua.lua @@ -12,6 +12,7 @@ M.config = function()        args = {},        stdin = false,      }, +    linters = { "luacheck" },    }  end @@ -34,8 +35,9 @@ M.format = function()  end  M.lint = function() -  -- TODO: implement linters (if applicable) -  return "No linters configured!" +  require("lint").linters_by_ft = { +    lua = O.lang.lua.linters, +  }  end  M.lsp = function() diff --git a/lua/lang/python.lua b/lua/lang/python.lua index 3bab555a..b4f74a6a 100644 --- a/lua/lang/python.lua +++ b/lua/lang/python.lua @@ -19,6 +19,11 @@ M.config = function()        exe = "yapf",        args = {},      }, +    linters = { +      "flake8", +      "pylint", +      "mypy", +    },    }  end @@ -40,41 +45,9 @@ M.format = function()  end  M.lint = function() -  if require("lv-utils").check_lsp_client_active "efm" then -    return -  end -  local python_arguments = {} - -  local flake8 = { -    LintCommand = "flake8 --ignore=E501 --stdin-display-name ${INPUT} -", -    lintStdin = true, -    lintFormats = { "%f:%l:%c: %m" }, +  require("lint").linters_by_ft = { +    python = O.lang.python.linters,    } - -  local isort = { formatCommand = "isort --quiet -", formatStdin = true } - -  if O.lang.python.linter == "flake8" then -    table.insert(python_arguments, flake8) -  end - -  if O.lang.python.isort then -    table.insert(python_arguments, isort) -  end - -  if not require("lv-utils").check_lsp_client_active "efm" then -    require("lspconfig").efm.setup { -      cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, -      init_options = { documentFormatting = true, codeAction = false }, -      root_dir = require("lspconfig").util.root_pattern(".git/", "requirements.txt"), -      filetypes = { "python" }, -      settings = { -        rootMarkers = { ".git/", "requirements.txt" }, -        languages = { -          python = python_arguments, -        }, -      }, -    } -  end  end  M.lsp = function() diff --git a/lua/lang/ruby.lua b/lua/lang/ruby.lua index f306025b..20618951 100644 --- a/lua/lang/ruby.lua +++ b/lua/lang/ruby.lua @@ -12,6 +12,7 @@ M.config = function()        exe = "rufo",        args = { "-x" },      }, +    linters = { "ruby" },    }  end @@ -33,8 +34,9 @@ M.format = function()  end  M.lint = function() -  -- TODO: implement linters (if applicable) -  return "No linters configured!" +  require("lint").linters_by_ft = { +    ruby = O.lang.ruby.linters, +  }  end  M.lsp = function() diff --git a/lua/lang/sh.lua b/lua/lang/sh.lua index f2a7fe78..e7c5ef16 100644 --- a/lua/lang/sh.lua +++ b/lua/lang/sh.lua @@ -15,6 +15,7 @@ M.config = function()        args = { "-w" },        stdin = false,      }, +    linters = { "shellcheck" },    }  end @@ -37,36 +38,9 @@ M.format = function()  end  M.lint = function() -  -- sh -  local sh_arguments = {} - -  local shfmt = { formatCommand = "shfmt -ci -s -bn", formatStdin = true } - -  local shellcheck = { -    LintCommand = "shellcheck -f gcc -x", -    lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" }, +  require("lint").linters_by_ft = { +    sh = O.lang.sh.linters,    } - -  if O.lang.sh.linter == "shellcheck" then -    table.insert(sh_arguments, shellcheck) -  end - -  if not require("lv-utils").check_lsp_client_active "efm" then -    require("lspconfig").efm.setup { -      -- init_options = {initializationOptions}, -      cmd = { DATA_PATH .. "/lspinstall/efm/efm-langserver" }, -      on_attach = require("lsp").common_on_attach, -      init_options = { documentFormatting = true, codeAction = false }, -      root_dir = require("lspconfig").util.root_pattern ".git/", -      filetypes = { "sh" }, -      settings = { -        rootMarkers = { ".git/" }, -        languages = { -          sh = sh_arguments, -        }, -      }, -    } -  end  end  M.lsp = function() diff --git a/lua/lang/tex.lua b/lua/lang/tex.lua index 7ebc84a0..7fdc8757 100644 --- a/lua/lang/tex.lua +++ b/lua/lang/tex.lua @@ -31,6 +31,7 @@ M.config = function()        signs = true,        underline = true,      }, +    linters = { "chktex" },      auto_save = false,      ignore_errors = {},    } @@ -42,8 +43,9 @@ M.format = function()  end  M.lint = function() -  -- TODO: implement linters (if applicable) -  return "No linters configured!" +  require("lint").linters_by_ft = { +    tex = O.lang.latex.linters, +  }  end  M.lsp = function() diff --git a/lua/lang/vim.lua b/lua/lang/vim.lua index 4c29a84a..4386757e 100644 --- a/lua/lang/vim.lua +++ b/lua/lang/vim.lua @@ -1,7 +1,9 @@  local M = {}  M.config = function() -  O.lang.vim = {} +  O.lang.vim = { +    linters = { "vint" }, +  }  end  M.format = function() @@ -10,8 +12,9 @@ M.format = function()  end  M.lint = function() -  -- TODO: implement linters (if applicable) -  return "No linters configured!" +  require("lint").linters_by_ft = { +    vim = O.lang.vim.linters, +  }  end  M.lsp = function() | 
