summaryrefslogtreecommitdiff
path: root/vim/.config/nvim/lua/westwood-lint.lua
blob: 04501b27dffd1862038c6815f6b4b0bd527b76f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local lint = require("lint")

local errorformat =
"%WWARNING: %m,%Z%\\s%\\s%\\s%\\s%\\s%\\s%\\s%\\s%\\sat (stdin) from line %l column %c to line %e column %k"
lint.linters.westwood = {
  cmd = '/homes/kkasad/share/westwood',
  stdin = true,
  args = { '-f', 'machine', '-' },
  stream = both,
  ignore_exitcode = false,
  env = nil,
  parser = require('lint.parser').from_errorformat(errorformat)
}

lint.linters_by_ft.c = { "westwood", "clangtidy" }
lint.linters_by_ft.cpp = { "westwood" }
vim.list_extend(lint.linters_by_ft.c, { "westwood", "clangtidy" })
vim.list_extend(lint.linters_by_ft.cpp, { "westwood" })

local ns = lint.get_namespace("westwood")
vim.diagnostic.config({ virtual_text = true }, ns)