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

Forbid equality checks against 'true' #51805

Merged
merged 1 commit into from
Feb 4, 2020

Conversation

pugnascotia
Copy link
Contributor

Add a Checkstyle rule to forbid equality checks against a literal 'true' value, since this is redundant. Follow up to #51723.

I also built a rule to prohibit logical negations i.e. !, but there are thousands of violations, so I left it in place for interest but commented it out. Maybe at some point we'll feel that we want it. It's probably an expensive rule.

Add a Checkstyle rule to forbid equality checks against a literal 'true'
value, since this is redundant. Follow up to elastic#51723.
@pugnascotia pugnascotia added :Core/Infra/Core Core issues without another label v8.0.0 labels Feb 3, 2020
@pugnascotia pugnascotia requested a review from rjernst February 3, 2020 11:24
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM.

Copy link
Member

@jasontedor jasontedor left a comment

Choose a reason for hiding this comment

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

LGTM.

@pugnascotia pugnascotia merged commit 5b5bdd1 into elastic:master Feb 4, 2020
@pugnascotia pugnascotia deleted the checkstyle-boolean-rules branch February 4, 2020 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >non-issue v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants