rspec/rules/S2589/python/rule.adoc

49 lines
726 B
Plaintext

== Why is this an issue?
include::../description.adoc[]
=== Noncompliant code example
[source,python]
----
def f(b):
a = True
if a: # Noncompliant
do_something()
if a and b: # Noncompliant; "a" is always "True"
do_something()
----
=== Compliant solution
[source,python]
----
def f(b):
a = True
if foo(a):
do_something()
if b:
do_something()
----
include::../see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
include::../highlighting.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]