rspec/rules/S2589/python/rule.adoc
2020-06-30 17:16:12 +02:00

32 lines
415 B
Plaintext

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[]