rspec/rules/S1481/python/rule.adoc
Alban Auzeill 2c306d110e Fix code block ambiguity with old header style
Ensure blank line before list and clean the one leading space
2020-06-30 17:16:12 +02:00

33 lines
559 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
<code>_</code> 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)
----