rspec/rules/S2589/python/rule.adoc

40 lines
579 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[]
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]