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 autocorrection for Lint/SafeNavigationWithEmpty #8172

Merged

Conversation

koic
Copy link
Member

@koic koic commented Jun 20, 2020

This PR supports autocorrection for Lint/SafeNavigationWithEmpty.


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 support_autocorrect_for_safe_navigation_with_empty branch from 0bcccfe to 1799495 Compare June 20, 2020 01:52
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 20, 2020

Hmm, that's a weird cop - why don't we check for all predicate methods? Seems to me they all suffer from the same problem.

@koic koic force-pushed the support_autocorrect_for_safe_navigation_with_empty branch from 1799495 to 1ad921d Compare June 21, 2020 01:26
@bbatsov
Copy link
Collaborator

bbatsov commented Jun 29, 2020

I'm fine with the PR, but I think this cop should be extended to cover all predicates, so it would be more useful.

@koic
Copy link
Member Author

koic commented Jun 29, 2020

I was late in replying 💦 This cop can be extended, it will be opened as another PR apart from this PR.

@koic koic force-pushed the support_autocorrect_for_safe_navigation_with_empty branch from 1ad921d to 1091943 Compare June 29, 2020 05:15
This PR supports autocorrection for `Lint/SafeNavigationWithEmpty`.
@koic koic force-pushed the support_autocorrect_for_safe_navigation_with_empty branch from 1091943 to c2fe004 Compare June 29, 2020 05:20
@koic koic merged commit 25efdd3 into rubocop:master Jun 29, 2020
@koic koic deleted the support_autocorrect_for_safe_navigation_with_empty branch June 29, 2020 06:20
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