2020-06-30 12:47:33 +02:00
|
|
|
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
|
|
|
|
|
2021-01-27 13:42:22 +01:00
|
|
|
``++_++`` as well as tuples will not raise an issue for this rule. The following examples are compliant:
|
2020-06-30 14:49:38 +02:00
|
|
|
|
2020-06-30 12:47:33 +02:00
|
|
|
----
|
|
|
|
for _ in range(10):
|
|
|
|
do_something()
|
|
|
|
username, login, password = auth
|
|
|
|
do_something_else(username, login)
|
|
|
|
----
|