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 #9298] Fix an incorrect auto-correct for Lint/RedundantCopDisableDirective #9299

Conversation

koic
Copy link
Member

@koic koic commented Dec 28, 2020

Fixes #9298.

This PR fixes an incorrect auto-correct for Lint/RedundantCopDisableDirective when there is a blank line before inline comment.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

…opDisableDirective`

Fixes rubocop#9298.

This PR fixes an incorrect auto-correct for `Lint/RedundantCopDisableDirective`
when there is a blank line before inline comment.
@koic koic force-pushed the fix_incorrect_autocorrect_for_redundant_cop_disable_directive branch from c573b0c to 7809e1d Compare December 29, 2020 02:24
Copy link
Collaborator

@jonas054 jonas054 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I had noticed this problem myself and was about to report it, when I saw that an issue and a PR already existed. Thanks, @koic!

@jonas054 jonas054 merged commit e12d1ea into rubocop:master Dec 30, 2020
@koic koic deleted the fix_incorrect_autocorrect_for_redundant_cop_disable_directive branch December 30, 2020 11:06
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.

Autofix results to invalid syntax when rubocop comment is removed. Style/RaiseArgs: EnforcedStyle: compact
2 participants