1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-23 22:04:49 +02:00

Handle multi-line statements edge-cases in the multi-line rule (#83)

There were many cases where the multi-line statements at the end of a
block were marked as containing empty lines, while they didn't. Or vice
versa.
This commit is contained in:
Genadi Samokovarov
2018-10-12 22:38:08 -07:00
committed by Minko Gechev
parent 69f012a7d9
commit 04516d2f82
2 changed files with 71 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ func (w lintEmptyLines) checkEnd(block *ast.BlockStmt) {
return
}
last := w.position(lastNode.Pos())
last := w.position(lastNode.End())
if end.Line-last.Line > 1 {
w.onFailure(lint.Failure{
Confidence: 1,