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

(Sonar) Fixed finding: "Boolean checks should not be inverted" #841

Merged

Conversation

pixeebot[bot]
Copy link
Contributor

@pixeebot pixeebot bot commented Sep 19, 2024

Remediation

This change fixes "Boolean checks should not be inverted" (id = python:S1940) identified by Sonar.

Details

This codemod flips boolean not comparisons to their more readable equivalent comparisons.

The changes from this codemod look like this:

- assert not user_input == "yes"
- z = not m <= n
+ assert user_input != "yes"
+ z = m > n
More reading

🧚🤖 Powered by Pixeebot

Feedback | Community | Docs | Codemod ID: sonar:python/invert-boolean-check

Copy link

Copy link
Contributor

@clavedeluna clavedeluna left a comment

Choose a reason for hiding this comment

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

Nice pixee!

@clavedeluna clavedeluna added this pull request to the merge queue Sep 19, 2024
github-merge-queue bot pushed a commit that referenced this pull request Sep 19, 2024
Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 19, 2024
@clavedeluna clavedeluna added this pull request to the merge queue Sep 19, 2024
Merged via the queue into main with commit bd86552 Sep 19, 2024
13 checks passed
@clavedeluna clavedeluna deleted the pixeebot/drip-2024-09-19-sonar-python/invert-boolean-check branch September 19, 2024 12:46
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.

1 participant