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

Skip global offenses to avoid "undefined method `begin'" #56

Merged
merged 2 commits into from Nov 18, 2021

Conversation

ohbarye
Copy link
Member

@ohbarye ohbarye commented Nov 18, 2021

Issue

Fixes #55

Change

As described #55 (comment), rdjson_formatter fails to build diagnostic when a given offense has NO_LOCATION.

NO_LOCATION indicates a global offense that has no particular location. For example, an empty file is applicable. Since no correction can be applied to global offenses, it should skip reporting (that's how action-rubodop@v1 works).

https://github.com/rubocop/rubocop/blob/de4f7cdd266999bf2cfbe78bd7fd8a0d4580863d/lib/rubocop/cop/base.rb#L105-L112

@ohbarye ohbarye changed the title Add test file that has global offense Skip global offenses to avoid "undefined method `begin'" Nov 18, 2021
@ohbarye
Copy link
Member Author

ohbarye commented Nov 18, 2021

@mgrachev Could you review this when you have time?

@mgrachev mgrachev merged commit 242ce74 into reviewdog:master Nov 18, 2021
@mgrachev
Copy link
Member

@ohbarye 👋 Thanks a lot for your help 🔥

@github-actions
Copy link
Contributor

🚀 [bumpr] Bumped! New version:v2.0.2 Changes:v2.0.1...v2.0.2

@ohbarye ohbarye deleted the skip-global-offense branch November 19, 2021 01:06
@ohbarye
Copy link
Member Author

ohbarye commented Nov 19, 2021

Thanks for your quick review too 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undefined method `begin' for PseudoSourceRange
2 participants