-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint Lua using Luacheck #10123
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using _opts
might be another alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.