Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This first commit avoid shadowing variables, ref #8 (comment)
Luacheck reports a number of other things. Removing trailing whitespace is one, but I agree with you that it is not important (and the suggestion can be disabled).
Complaining about globals #10 is another one.
Another one, which I think is quite meaningful as it can catch a mismatch between intent and behavior, is reporting unused variables or arguments. Some examples:
For the first two, the idea would be to replace the binding to
ci
ori
with bindings to_
which I understand is the convention to say explicitly that you are not interested in the value (as opposed to not using it due to a typo or other mistake in later code). For example, line 561 would become:line 723:
For line 768 (and several similar ones), I understand it the function will likely be called with the current buffer
b
(from a key binding), but theb
is not used. I could understand why you might want to keep the argument to show the expected way it will be called.In any case, if you are interested I can push more commits for things like the unused variables.
Note that I haven't run luacheck over
pleterm.lua
orbuffer.lua
. I thought it best to limit tople.lua
until I know what may interest you in terms of pull requests.