Skip to content

Commit

Permalink
chore: port codespell (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoshihou514 authored Sep 11, 2023
1 parent fdb9b71 commit 15c9901
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- [x] [black](https://github.com/psf/black)
- [x] [cbfmt](https://github.com/lukas-reineke/cbfmt)
- [x] [clang-format](https://www.kernel.org/doc/html/latest/process/clang-format.html)
- [ ] [codespell](https://github.com/codespell-project/codespell)
- [ ] [djhtml](https://github.com/rtts/djhtml)
- [ ] [fish_indent](https://fishshell.com/docs/current/cmds/fish_indent.html)
- [ ] [fnlfmt](https://git.sr.ht/~technomancy/fnlfmt)
Expand Down
20 changes: 20 additions & 0 deletions lua/guard-collection/linter/codespell.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
local lint = require('guard.lint')
return {
cmd = 'codespell',
args = {
'-',
},
stdin = true,
parse = function(result, bufnr)
local diags = {}
local t = vim.split(result, '\n')
for i, e in ipairs(t) do
local lnum = e:match('^%d+')
if lnum then
diags[#diags + 1] =
lint.diag_fmt(bufnr, tonumber(lnum) - 1, 0, t[i + 1]:gsub('\t', ''), 2, 'codespell')
end
end
return diags
end,
}

0 comments on commit 15c9901

Please sign in to comment.