rspec/rules/S1721/python/rule.adoc

41 lines
793 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Parentheses are not required after the ``++assert++``, ``++del++``, ``++elif++``, ``++except++``, ``++for++``, ``++if++``, ``++in++``, ``++not++``, ``++raise++``, ``++return++``, ``++while++``, and ``++yield++`` keywords, and using them unnecessarily impairs readability. They should therefore be omitted.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,python]
2021-04-28 16:49:39 +02:00
----
x = 1
while (x < 10):
print "x is now %d" % (x)
x += 1
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,python]
2021-04-28 16:49:39 +02:00
----
x = 1
while x < 10:
print "x is now %d" % (x)
x += 1
----
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[]