Lint Lua using Luacheck#10123
Conversation
cf6d6ce to
7ca57bd
Compare
| @@ -1,4 +1,4 @@ | |||
| function ByteStringReader (input, opts) | |||
| function ByteStringReader (input, _) | |||
There was a problem hiding this comment.
Having reviewed and dealt with 100% of the lint errors thrown my luacheck on the entire code base, this is the one default lint I'm not so sure is helpful for this project. Since much of the Lua code in this repository is examples that people will be expected to extend rather than use as-is in production, the unused variable and unused argument lints might be counter productive. Thoughts?
There was a problem hiding this comment.
Using _opts might be another alternative.
There was a problem hiding this comment.
In my book that's a reasonable convention, and luacheck supports it. Some other Lua linters do not (e.g. lua-language-server flags it) but I'm still down. I just refactored all the lint handling using that method.
This is dependent on the upstream PR adding builtin support for Pandoc to Luacheck, see lunarmodules/luacheck#115. I'll take it out of draft mode when that is in a release ... which could be sooner rather than later if feedback here/there is reasonable. The main motivation for adding the presets is using it on my own filters ... running it on the Pandoc repo was just a handy way to give it a shaking out.