rspec/rules/S2319/python/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

33 lines
627 B
Plaintext

== Why is this an issue?
Python has no pre/post increment/decrement operator. For instance, ``x{plus}{plus}`` and ``++x--++`` will fail to parse. More importantly, ``{plus}{plus}x`` and ``++--x++`` will do nothing. To increment a number, simply write ``++x += 1++``.
=== Noncompliant code example
[source,python]
----
++x # Noncompliant
----
=== Compliant solution
[source,python]
----
x += 1
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Python does not include the [pre|post][increment|decrement] operator.
endif::env-github,rspecator-view[]