rspec/rules/S1940/python/rule.adoc
marco-bearzi-sonarsource 27cf7b278f
Modify rule S1940: Add code examples for python (#897)
* Modify rule S1940: Add code examples for python

* Fix path
2022-03-14 11:23:49 +01:00

33 lines
498 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,python]
----
if not a == 2: # Noncompliant
b = not i < 10 # Noncompliant
----
== Compliant Solution
[source,python]
----
if a != 2 :
b = i >= 10
----
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[]