rspec/rules/S1481/python/rule.adoc
2023-04-13 14:00:03 +02:00

50 lines
819 B
Plaintext

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