vala-lang/vala-lint

space-before-paren returning incorrect column

Opened this issue · 3 comments

This issue was found in #146 (comment) but I thought I'd file it separately. The following code should have the same column for each error but the first one always returns off by one.

func1()
func2()
func3()

Output:

1.6     error   Expected space before paren                     space-before-paren
2.5     error   Expected space before paren                     space-before-paren
3.5     error   Expected space before paren                     space-before-paren

This is the code causing this:

vala-lint/lib/Utils.vala

Lines 91 to 93 in 2db0180

if (line_count == 0) {
column += reference.column;
}

We are adding 1 to the column number if the error is on the first line (line_count == 0). I don't know why.

Do @pantor or @jeremypw know why this is there?

Not sure why. These lines are from a @pantor commit.