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

add checker for accidental constants in boolean operators #7273

Merged

Conversation

Projects
None yet
3 participants
@cosmicexplorer
Copy link
Contributor

commented Feb 21, 2019

Problem

It's possible to accidentally write something like None or 'default_value', which is often an error indicating that the original value is dropped. One example is in 13b8505 for #7269 just now.

Solution

  • Add a checker for and/or expressions which ensures that the left-hand side is probably not a constant, and ensures that the right-hand side is probably not a constant for and expressions.

Result

One possible class of error that I just made is impossible.

@stuhood
Copy link
Member

left a comment

Thanks!

Looks like the CI failure is legit.

@cosmicexplorer cosmicexplorer force-pushed the cosmicexplorer:add-constant-logic-checker branch from 1e74c87 to fe26642 Feb 22, 2019

@Eric-Arellano
Copy link
Contributor

left a comment

Very cool! Comments are mostly nits and feel free to ignore.

@cosmicexplorer cosmicexplorer force-pushed the cosmicexplorer:add-constant-logic-checker branch from e9e3865 to 7345a09 Feb 26, 2019

cosmicexplorer added some commits Feb 21, 2019

@cosmicexplorer cosmicexplorer force-pushed the cosmicexplorer:add-constant-logic-checker branch from 7345a09 to f3b23ff Mar 1, 2019

@cosmicexplorer cosmicexplorer merged commit 3c5c70f into pantsbuild:master Mar 1, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.