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

Support auto-correction for Lint/ElseLayout #8992

Merged

Conversation

koic
Copy link
Member

@koic koic commented Nov 4, 2020

This PR supports auto-correction for Lint/ElseLayout.


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 (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.
  • 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 support_autocorrect_for_lint_else_layout branch 2 times, most recently from 6325c89 to 356f0c6 Compare November 4, 2020 16:25
@bbatsov
Copy link
Collaborator

bbatsov commented Nov 4, 2020

Looks good to me. We should probably clarify in the examples that's a lint cop, as often people type else when they meant elsif. The cop message makes that clear, but there's no example about this. We should also clarify the auto-correct assumes that we're facing a layout issue, not a logical issue.

@koic koic force-pushed the support_autocorrect_for_lint_else_layout branch from 356f0c6 to 3476fe2 Compare November 4, 2020 17:08
@koic
Copy link
Member Author

koic commented Nov 4, 2020

Certainly it is very valuable information! I updated the doc.

This PR supports auto-correction for `Lint/ElseLayout`.
@koic koic force-pushed the support_autocorrect_for_lint_else_layout branch from 3476fe2 to f14f26c Compare November 4, 2020 17:57
@bbatsov bbatsov merged commit de893b4 into rubocop:master Nov 4, 2020
@bbatsov
Copy link
Collaborator

bbatsov commented Nov 4, 2020

Great!

@koic koic deleted the support_autocorrect_for_lint_else_layout branch November 4, 2020 21:24
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