rspec/rules/S1481/python/rule.adoc
2021-06-02 20:44:38 +02:00

40 lines
692 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
----
def hello(name):
message = "Hello " + name # Noncompliant
print(name)
for i in range(10):
foo()
----
== Compliant Solution
----
def hello(name):
message = "Hello " + name
print(message)
for _ in range(10):
foo()
----
== Exceptions
``++_++`` as well as tuples will not raise an issue for this rule. The following examples are compliant:
----
for _ in range(10):
do_something()
username, login, password = auth
do_something_else(username, login)
----
ifdef::rspecator-view[]
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::rspecator-view[]