feat: add checking against multiple statements per line (#123)#128
feat: add checking against multiple statements per line (#123)#128arichard4 wants to merge 5 commits into
Conversation
|
Note that we can't use "code_lines"- it's a boolean, and it can't be made numeric because it has potential false positives here. (It tracks "line" as well as "state.lexer.line", potentially the same or next line.) |
09da9b9 to
8500117
Compare
|
@alerque Updated. For the sort of case you were looking at, the following will not trigger the new warning: However, if you stick multiple statements on the same line inside those blocks, they will emit warnings now. There is one case in luacheck's existing code which fails, which I have modified: The new lint flags that the print and exit statements are on the same line; I've put them on different lines. |
|
The latter case is, I think, wrong regardless; but we might want to add an explicit escape hatch to ignore multiple semicolon separated statements per line. I've changed it to this: I'm not sure if we'd want this lint to explicitly permit this: |
No description provided.