Skip to content
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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Lint Lua using Luacheck #10123

wants to merge 4 commits into from

Conversation

alerque
Copy link
Contributor

@alerque alerque commented Aug 27, 2024

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.

@alerque alerque force-pushed the luacheck branch 2 times, most recently from cf6d6ce to 7ca57bd Compare August 28, 2024 10:16
@@ -1,4 +1,4 @@
function ByteStringReader (input, opts)
function ByteStringReader (input, _)
Copy link
Contributor Author

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?

Copy link
Owner

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants