-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Don't let RuboCop blow up when removing .rubocop_todo.yml
#3396
Comments
Maybe still make it fail with a more clear error message unless the user is running with |
Yeah. I'm okay with that too. 😀 |
I couldn't reproduce the problem. Steps Followed
Tried with ruby 2.3.0 as well. |
@absk1317: Something has changed on current As evidenced by the message when running
|
As far as I know, it's always been like that. 👍 on failing with an error message pointing to the unsuccessful |
Given that this has been approved by Jonas, I'd be happy to work on it, unless anyone else already is? |
@jaredbeck: Feel free to have a go at it. Would love to see this in place. 🙂 |
Fixed by #4972 |
Instead of a stack trace, prints a friendly (concise) message to stderr when a configuration file, e.g. inherit_from, cannot be found. We use the constant Errno::ENOENT because it is present on all major operating systems. According to the ruby documenation, there may be some odd platforms that do not support this standard. If we find that someone is using rubocop on such a platform, we can rescue SystemCallError instead, but that will make it hard to exit with the correct exit code.
Running
bundle exec rubocop --auto-gen-config
will edit.rubocop.yml
to inherit from.rubocop_todo.yml
. If the latter is removed, subsequently runningbundle exec rubocop
will result in an unhandled exception.I think we should emit a warning instead, or worst case exit with an appropriate message.
Expected behavior
(RuboCop continues to run.)
Actual behavior
Steps to reproduce the problem
bundle exec rubocop --auto-gen-config
.rubocop_todo.yml
bundle exec rubocop
RuboCop version
Include the output of
rubocop -V
:The text was updated successfully, but these errors were encountered: