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

Unexpected DepartmentMissing in explanatory comments #7993

Closed
zverok opened this issue May 19, 2020 · 0 comments · Fixed by #7995
Closed

Unexpected DepartmentMissing in explanatory comments #7993

zverok opened this issue May 19, 2020 · 0 comments · Fixed by #7995
Labels

Comments

@zverok
Copy link
Contributor

zverok commented May 19, 2020

I am not sure on which version it started (recently, something around ~80), but now I get a lot of warnings on lines looking like this:

# rubocop:disable SomeDepartment/SomeCop -- because something, something, and something

Seems like Migration/DepartmentName cop treats every comma as a sign to look for new cop... And becomes disappointed. Real example (at 0.83.0):

spec/factories/revision_data.rb:65:52: C: Migration/DepartmentName: Department name is missing.
    # rubocop:disable Lint/PercentStringArray -- no, silly, we need those ","!
                                                     ^^^^^

As there are no other warnings (like "unknown cop"), I believe the problem is just in Migration/DepartmentName cop.

@koic koic added the bug label May 19, 2020
koic added a commit to koic/rubocop that referenced this issue May 20, 2020
Fixes rubocop#7993.

This PR fixes a false positive for `Migration/DepartmentName` cop
when a disable comment contains an unexpected character for department name.
bbatsov pushed a commit that referenced this issue May 21, 2020
Fixes #7993.

This PR fixes a false positive for `Migration/DepartmentName` cop
when a disable comment contains an unexpected character for department name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants