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

Mark Rails/UniqBeforePluck cop as unsafe auto-correction #331

Merged

Conversation

koic
Copy link
Member

@koic koic commented Aug 17, 2020

Follow #320 and rubocop/rubocop#8529.

This PR changes the mark of Rails/UniqBeforePluck from Safe: false to SafeAutoCorrect: false.

False positives to detection are not a concern. Only worry about incompatibilities with auto-correction.

Below is an excerpt from the official document.

  • Safe (true/false) - indicates whether the cop can yield false positives (by design) or not.

  • SafeAutoCorrect (true/false) - indicates whether the auto-correct a cop does is safe (equivalent) by design. If a cop is unsafe its auto-correct automatically becomes unsafe as well.

https://docs.rubocop.org/rubocop/0.89/usage/auto_correct.html#safe-auto-correct

Cc @kunitoo


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.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.
  • 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.

Follow rubocop#320 and rubocop/rubocop#8529.

This PR changes the mark of `Rails/UniqBeforePluck` from `Safe: false`
to `SafeAutoCorrect: false`.

False positives to detection are not a concern. Only worry about
incompatibilities with auto-correction.

Below is an excerpt from the official document.

> * Safe (true/false) - indicates whether the cop can yield false
> positives (by design) or not.
>
> * SafeAutoCorrect (true/false) - indicates whether the auto-correct a cop
> does is safe (equivalent) by design. If a cop is unsafe its auto-correct
> automatically becomes unsafe as well.

https://docs.rubocop.org/rubocop/0.89/usage/auto_correct.html#safe-auto-correct
@koic koic force-pushed the mark_safe_autocorrect_for_rails_uniq_before_pluck branch from 7ec4efd to 523ddfb Compare August 17, 2020 23:45
@koic koic merged commit 8d97561 into rubocop:master Aug 19, 2020
@koic koic deleted the mark_safe_autocorrect_for_rails_uniq_before_pluck branch August 19, 2020 10:33
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

1 participant