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

check for if-blocks with boolean literals for both branches #217

Open
wants to merge 2 commits into
base: master
from

Conversation

@brandly
Copy link

commented Oct 9, 2019

hey! i saw #200 and wanted to get more familiar with this repo.

here, we check for situations where both branches of an if are a boolean literal e.g.

if <condition> then
    True

else
    False

i attempted to find unnecessary comparisons like if <condition> == True, but i couldn't figure out the pattern match. it also made me wonder if we should look for if <condition> == True or more generally just <condition> == True in all expressions, since such a comparison is unnecessary regardless of the if context.

potentially, that's a separate check or maybe this check should be expanded to address it. regardless, i was looking at this last night, but i wanted to get some feedback before proceeding. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.