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

Rubocop silently fails with small error in config file #7725

Closed
smackesey opened this issue Feb 18, 2020 · 7 comments
Closed

Rubocop silently fails with small error in config file #7725

smackesey opened this issue Feb 18, 2020 · 7 comments
Labels

Comments

@smackesey
Copy link

Rubocop seems to silently fail when there is a small typo in a configuration file.


Expected behavior

Rubocop should print an error message indicating that the config file did not parse correctly.

Actual behavior

Rubocop runs but does not actually perform any linting.

Steps to reproduce the problem

Create a directory with two files:

.rubocop.yml

LayoutEmptyLinesAroundArguments:
  Enabled: false

test.rb

def badName
  if something
    test
    end
end

Now go to the directory and run rubocop --debug test.rb. You should see some debug output inidicating configuration loading but no linting output.

RuboCop version

0.80.0 (using Parser 2.7.0.2, running on ruby 2.7.0 x86_64-darwin19)

@bbatsov bbatsov added the bug label Feb 19, 2020
@tejasbubane
Copy link
Contributor

Output shows unrecognized cop. Should this be improved?

Inheriting configuration from /Users/tejas.bubane/opensource/rubocop/.rubocop_todo.yml
Error: unrecognized cop LayoutEmptyLinesAroundArguments found in .rubocop.yml
Finished in 0.2368809999898076 seconds

@smackesey
Copy link
Author

@tejasbubane Hmm, I don't get this message. Here is my output:

For /Users/smackesey/Desktop/tester: configuration from /Users/smackesey/Desktop/tester/.rubocop.yml
Default configuration from /Users/smackesey/.asdf/installs/ruby/2.7.0/lib/ruby/gems/2.7.0/gems/rubocop-0.80.0/config/default.yml
Finished in 0.07307699997909367 seconds

@lxxxvi
Copy link
Contributor

lxxxvi commented Jun 9, 2020

I also get the (expected) error

Error: unrecognized cop LayoutEmptyLinesAroundArguments found in .rubocop.yml

(Ruby 2.7.1, RuboCop 0.85.1)

@tejasbubane
Copy link
Contributor

@smackesey Are you still getting that error with latest rubocop?

@smackesey
Copy link
Author

smackesey commented Jun 9, 2020

Just tested again with rubocop 0.85.1, ruby 2.7.1.

[I] ❯ rubocop --debug test.rb
For /Users/smackesey/Desktop/tester: configuration from /Users/smackesey/Desktop/tester/.rubocop.yml
Default configuration from /Users/smackesey/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rubocop-0.85.1/config/default.yml
Finished in 0.07465199998114258 seconds

Still no error message for me.

@stale
Copy link

stale bot commented Dec 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale Issues that haven't been active in a while label Dec 6, 2020
@dvandersluis
Copy link
Member

This will now (as of #9171, not released yet) output the following (it outputs on stderr so if you're still having this issue check that maybe you're not suppressing it):

Error: unrecognized cop LayoutEmptyLinesAroundArguments found in .rubocop.yml
Did you mean `Layout/EmptyLinesAroundArguments`?

I think this issue can be closed. (/cc @bbatsov)

@stale stale bot removed the stale Issues that haven't been active in a while label Dec 7, 2020
@koic koic closed this as completed Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants