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 #10846] Fix a false negative for Style/DoubleNegation when there is a hash or an array at return location of method. #10855

Conversation

nobuyo
Copy link
Contributor

@nobuyo nobuyo commented Aug 2, 2022

This PR fixes #10846.


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • 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.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • 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.

@nobuyo nobuyo force-pushed the fix-false-positive-for-style-double-nagation-when-hash-or-array-at-return-loc branch 2 times, most recently from 1e669f9 to d21d828 Compare August 4, 2022 10:50
@@ -0,0 +1 @@
* [#10846](https://github.com/rubocop/rubocop/issues/10846): Fix a false positive for `Style/DoubleNagation` when there is a hash or an array at return location of method. ([@nobuyo][])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nagation -> Negation

@bbatsov
Copy link
Collaborator

bbatsov commented Aug 4, 2022

Btw, it seems to me the fix addresses a false negative, not a false positive.

@nobuyo nobuyo force-pushed the fix-false-positive-for-style-double-nagation-when-hash-or-array-at-return-loc branch from d21d828 to 634201d Compare August 4, 2022 13:03
@nobuyo nobuyo changed the title [Fix #10846] Fix a false positive for Style/DoubleNagation when there is a hash or an array at return location of method. [Fix #10846] Fix a false negative for Style/DoubleNegation when there is a hash or an array at return location of method. Aug 4, 2022
…hen there is a hash or an array at return location of method
@nobuyo nobuyo force-pushed the fix-false-positive-for-style-double-nagation-when-hash-or-array-at-return-loc branch from 634201d to ee1ff39 Compare August 4, 2022 13:06
@nobuyo
Copy link
Contributor Author

nobuyo commented Aug 4, 2022

Oops, you're right. I've fixed the problems, thanks.

@bbatsov bbatsov merged commit 76c2285 into rubocop:master Aug 5, 2022
@bbatsov
Copy link
Collaborator

bbatsov commented Aug 5, 2022

Thanks!

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.

Style/DoubleNegation: does not register an offence for last line of a returned hash/array
2 participants