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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Layout/AccessModifierIndentation work with arbitrary blocks #6574

Merged
merged 3 commits into from
Dec 24, 2018
Merged

Make Layout/AccessModifierIndentation work with arbitrary blocks #6574

merged 3 commits into from
Dec 24, 2018

Conversation

deivid-rodriguez
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez commented Dec 12, 2018

This PR makes the Layout/AccessModifierIndentation cop work for arbitrary blocks, and not only for dynamic class or module definitions. It is built on top of #6573, so any revieweres please have a look at that one first.

This PR changes the expectation of an existing spec, which explicitly stated that this case should not be detected. I don't see why, though. The spec was introduced in d2c0423 as part of a refactor. Neither the commit message nor the associated PR explain the reason for the spec, so I would appreciate some input here.

Also, I'm unsure whether to tag this a "bug fix", "feature", or "change" if this is accepted 馃槂.


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 Changed 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.

@deivid-rodriguez deivid-rodriguez changed the title Access modifier indentation and arbitrary blocks Make Layout/AccessModifierIndentation work with arbitrary blocks Dec 18, 2018
@bbatsov
Copy link
Collaborator

bbatsov commented Dec 23, 2018

I messed up a little bit, as I accidentally squashed the commits in your other PR. Rebase to master and I'll merge this one as well.

@deivid-rodriguez
Copy link
Contributor Author

@bbatsov I rebased it and, although I'm not fully sure about how to tag this PR, I went with calling this a bug fix.

@bbatsov bbatsov merged commit 4b3d3e1 into rubocop:master Dec 24, 2018
@bbatsov
Copy link
Collaborator

bbatsov commented Dec 24, 2018

Thanks!

@deivid-rodriguez deivid-rodriguez deleted the access_modifier_indentation_and_arbitrary_blocks branch December 25, 2018 10:08
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.

None yet

2 participants