You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to just check syntax with Rubocop using the command rubocop --only Lint/Syntax fails with "Unrecognised cop or namespace".
I was able to only run the syntax cop with rubocop --only "", but this looks very hacky so I don't think it's a solution. (Note that rubocop --only fails trying to call Array#split on nil, this might want to be fixed, to behave the same as passing "").
After some very quick digging it seems the issue with the missing cop is due to RuboCop::Cop::Cop.all not exposing Lint/Syntax as a real cop, I imagine there are various reasons for this so I doubt changing that is the solution, and popping Lint/Syntax onto the cops array only in RuboCop::Options might get messy. Therefore I think the simplest solution might be to add a new switch such as rubocop --syntax, that only runs the syntax checker and exits (being functionally the same as what rubocop --only "" does now).
Version: 0.34.2 (using Parser 2.2.3.0, running on ruby 2.2.3 x86_64-linux)
Thanks!
The text was updated successfully, but these errors were encountered:
Trying to just check syntax with Rubocop using the command
rubocop --only Lint/Syntax
fails with "Unrecognised cop or namespace".I was able to only run the syntax cop with
rubocop --only ""
, but this looks very hacky so I don't think it's a solution. (Note thatrubocop --only
fails trying to callArray#split
onnil
, this might want to be fixed, to behave the same as passing""
).After some very quick digging it seems the issue with the missing cop is due to
RuboCop::Cop::Cop.all
not exposing Lint/Syntax as a real cop, I imagine there are various reasons for this so I doubt changing that is the solution, and poppingLint/Syntax
onto the cops array only inRuboCop::Options
might get messy. Therefore I think the simplest solution might be to add a new switch such asrubocop --syntax
, that only runs the syntax checker and exits (being functionally the same as whatrubocop --only ""
does now).Version:
0.34.2 (using Parser 2.2.3.0, running on ruby 2.2.3 x86_64-linux)
Thanks!
The text was updated successfully, but these errors were encountered: