Ale: Rubocop syntax error displayed as warning instead of error

Created on 16 Nov 2016  路  6Comments  路  Source: dense-analysis/ale

When a ruby file contains a syntax error, all other linter warnings are not displayed anymore, and the line with the error is displayed with the warning signs:

screen shot 2016-11-16 at 11 19 21

The corresponding error message is:

Unexpected token tIDENTIFIER (Using Ruby 2.3 parser; configure using `TargetRubyVersion` parameter, under `AllCops`)

Is this a bug or expected behavior?

bug

Most helpful comment

P.S. I just complained about a bug and forgot to first thank you for making ale. It's super useful, so here is a big thank you! 馃帀

All 6 comments

I think it just shows all messages as warnings. Someone will need to have a look at the linter and figure out some way to show some messages as errors, and some as warnings. Or perhaps all messages should be errors. If someone knows Ruby better than I do, they can have a look.

@w0rp actually - other things are displayed as errors by rubocop, I believe. If we remove the line with the invalid syntax from the example above, it looks like this:

screen shot 2016-11-16 at 11 31 58

P.S. I just complained about a bug and forgot to first thank you for making ale. It's super useful, so here is a big thank you! 馃帀

I like complaining. Complaining is the first step towards fixing anything.

It seems that Rubocop returns an E error code for syntax errors, but rubocop#Handle expects for C as an error. (https://github.com/w0rp/ale/blob/master/ale_linters/ruby/rubocop.vim#L29).

Changing this line to

        \   'type': index(['C', 'E'], l:type) != -1 ? 'E' : 'W',

Fixes the issue.

I have pushed that line as a fix for this now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EdmundsEcho picture EdmundsEcho  路  3Comments

aressler38 picture aressler38  路  3Comments

plexigras picture plexigras  路  3Comments

glepnir picture glepnir  路  3Comments

trevordmiller picture trevordmiller  路  3Comments