Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unrecognized cop Syntax found #925

Closed
tmorris-fiksu opened this issue Mar 28, 2014 · 3 comments
Closed

unrecognized cop Syntax found #925

tmorris-fiksu opened this issue Mar 28, 2014 · 3 comments
Assignees

Comments

@tmorris-fiksu
Copy link
Contributor

$rubocop --auto-gen
generates a rubocop-todo.yml file with the following lines:

Syntax:
  Enabled: false

However, this leads to:

Warning: unrecognized cop Syntax found in .../.rubocop.todo.yml

Please let me know if that is enough to go on, or if you need a test case. The project that generated it is pretty big, and I'm not sure which file caused these broken lines.

@tmorris-fiksu
Copy link
Contributor Author

Turns out, it's actually really easy to create this warning. Note that I think it is fine for --auto-gen not to be able to cause Errors to be ignored. However, the warning line is a problem, so I guess that the Syntax: line should simply not be emitted.

$ cat derp.rb
def derp

$ rubocop --auto-gen
Inspecting 1 file
E

Offenses:

derp.rb:2:1: E: unexpected token $end

1 file inspected, 1 offense detected
Created rubocop-todo.yml.
Run rubocop with --config rubocop-todo.yml, or
add inherit_from: rubocop-todo.yml in a .rubocop.yml file.

$ rubocop --config rubocop-todo.yml
Warning: unrecognized cop Syntax found in /Users/tmorris/scratch/rubo-sample/syntax/rubocop-todo.yml
Inspecting 1 file
E

Offenses:

derp.rb:2:1: E: unexpected token $end

1 file inspected, 1 offense detected
Mar28@15:55:57 (ruby-1.9.3-p484)
[~/scratch/rubo-sample/syntax] (!5646) $ rubocop -V
0.19.1 (using Parser 2.1.7, running on ruby 1.9.3 x86_64-darwin12.5.0)

@bbatsov
Copy link
Collaborator

bbatsov commented Mar 30, 2014

@jonas054 Would you look into this?

@jonas054 jonas054 self-assigned this Mar 30, 2014
@jonas054
Copy link
Collaborator

Yes!

bbatsov added a commit that referenced this issue Apr 3, 2014
[Fix #925] Don't disable Syntax cop in rubocop-todo.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants