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 #120] Fix save-in-conditional checking in Rails/SaveBang #121

Merged
merged 1 commit into from
Sep 17, 2019

Conversation

jas14
Copy link
Contributor

@jas14 jas14 commented Aug 28, 2019

Fixes #120.

The Rails/SaveBang rule emitted incorrect errors about using the return value of save-like calls in conditional nodes. It did not differentiate between such calls in the body versus the condition, where only the latter is necessarily a boolean expression.


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.

@jas14
Copy link
Contributor Author

jas14 commented Sep 3, 2019

ping

@jas14 jas14 force-pushed the fix-savebang-in-conditional branch from f4f1573 to c5bb3fb Compare September 11, 2019 17:41
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
@jas14 jas14 force-pushed the fix-savebang-in-conditional branch from c5bb3fb to e840afe Compare September 13, 2019 15:45
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor Author

@jas14 jas14 left a comment

Choose a reason for hiding this comment

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

Thanks for the continued reviews @koic !

Fixes rubocop#120.

The Rails/SaveBang rule emitted incorrect errors about using the return
value of save-like calls in conditional nodes. It did not differentiate
between such calls in the body versus the condition, where only the
latter is necessarily a boolean expression.
@jas14 jas14 force-pushed the fix-savebang-in-conditional branch from e840afe to f7287a2 Compare September 16, 2019 03:39
@koic koic merged commit ee0176b into rubocop:master Sep 17, 2019
@koic
Copy link
Member

koic commented Sep 17, 2019

Thanks!

@jas14 jas14 deleted the fix-savebang-in-conditional branch January 24, 2020 15:16
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.

Rails/SaveBang "check used in conditional" false positive
2 participants