Skip to content

Commit

Permalink
Add luac linter
Browse files Browse the repository at this point in the history
  • Loading branch information
eestrada committed Sep 20, 2024
1 parent b178f85 commit 7cf7fd7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Other dedicated linters that are built-in are:
| [ktlint][ktlint] | `ktlint` |
| [lacheck][lacheck] | `lacheck` |
| [Languagetool][5] | `languagetool` |
| [luac][luac] | `luac` |
| [luacheck][19] | `luacheck` |
| [markdownlint][26] | `markdownlint` |
| [markdownlint-cli2][markdownlint-cli2] | `markdownlint-cli2` |
Expand Down Expand Up @@ -495,6 +496,7 @@ busted tests/
[phpstan]: https://phpstan.org/
[psalm]: https://psalm.dev/
[lacheck]: https://www.ctan.org/tex-archive/support/lacheck
[luac]: https://www.lua.org/manual/5.1/luac.html
[credo]: https://github.com/rrrene/credo
[ghdl]: https://github.com/ghdl/ghdl
[glslc]: https://github.com/google/shaderc
Expand Down
12 changes: 12 additions & 0 deletions lua/lint/linters/luac.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
return {
cmd = "luac",
stdin = true,
append_fname = false,
args = { "-p", "-" },
stream = "stderr",
ignore_exitcode = true,
parser = require("lint.parser").from_errorformat("luac:\\ stdin:%l:\\ %m,%-G%.%#", {
source = "luac",
severity = vim.diagnostic.severity.ERROR,
}),
}

0 comments on commit 7cf7fd7

Please sign in to comment.