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

fix crash when loading an empty config file #611

Conversation

sinisterchipmunk
Copy link
Contributor

YAML returns false when the file contains no real data, even if it does contain comments. This breaks Rubocop, which is expecting a Hash.

This is a real-world issue because rubocop-todo.yml instructs the user to remove items one by one until everything's green, but doing so causes a crash when the final item is removed.

This pull request simply ensures that a Hash is used if YAML returns false.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) when pulling 71437be on sinisterchipmunk:support-empty-config-files into 415e648 on bbatsov:master.

@jonas054
Copy link
Collaborator

jonas054 commented Nov 7, 2013

👍 Great! Please add a line about the bug fix in CHANGELOG.md.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.09%) when pulling 7912e68 on sinisterchipmunk:support-empty-config-files into 415e648 on bbatsov:master.

@jonas054
Copy link
Collaborator

jonas054 commented Nov 7, 2013

Good, but it looks like you also need to rebase on top of the latest master. While you're at it, you can squash your two commits into one.

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 12, 2013

I've squashed and rebased this myself. Thanks!

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

Successfully merging this pull request may close these issues.

4 participants