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 #7212] Fix a false positive for Layout/EmptyLinesAroundAccessModifier #7377

Conversation

koic
Copy link
Member

@koic koic commented Sep 25, 2019

Fixes #7212.
Fixes #7246.

This PR fixes a false positive for Layout/EmptyLinesAroundAccessModifier and UselessAccessModifier when using method with the same name as access modifier around a method definition.

The main changes are as follows.


Before submitting the PR make sure the following are checked:

  • 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.
  • Added an entry to the Changelog if the new code introduces user-observable changes. See changelog entry format.
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Run bundle exec rake default. It executes all tests and RuboCop for itself, and generates the documentation.

@koic koic force-pushed the fix_a_false_positive_for_empty_line_around_access_modifier branch from ce9ca6c to c889384 Compare September 29, 2019 06:15
@bbatsov
Copy link
Collaborator

bbatsov commented Sep 29, 2019

Seems the build got stuck.

…ccessModifier`

Fixes rubocop#7212.
Fixes rubocop#7246.

This PR fixes a false positive for `Layout/EmptyLinesAroundAccessModifier` and
`UselessAccessModifier` when using method with the same name as access modifier
around a method definition.

The main changes are as follows.

- Added test for where rubocop#7194 change did not find a regression.
- The implementation needed to resolve rubocop#7186 will be moved to `Style/MixinUsage` cop.
This solves false positives that occurred in other cops.
@koic koic force-pushed the fix_a_false_positive_for_empty_line_around_access_modifier branch from c889384 to d568438 Compare September 29, 2019 06:40
@bbatsov bbatsov merged commit 75fb16d into rubocop:master Sep 30, 2019
@bbatsov
Copy link
Collaborator

bbatsov commented Sep 30, 2019

Thanks!

@koic koic deleted the fix_a_false_positive_for_empty_line_around_access_modifier branch October 1, 2019 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants