rspec/rules/S2589/python/rule.adoc

32 lines
415 B
Plaintext
Raw Normal View History

2020-06-30 12:48:07 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
a = True;
if a: # Noncompliant
doSomething()
if b and a: # Noncompliant; "a" is always "True"
doSomething()
if c or not a: # Noncompliant; "not a" is always "False"
doSomething()
----
== Compliant Solution
----
a = True;
if foo(a):
doSomething()
if b:
doSomething()
if c:
doSomething()
----
include::../see.adoc[]