rspec/rules/S2761/plsql/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

44 lines
1005 B
Plaintext

== Why is this an issue?
Calling the ``+``, ``++-++`` or ``++NOT++`` prefix operator twice does nothing: the second invocation undoes the first. Such mistakes are typically caused by accidentally double-tapping the key in question without noticing.
Either this is a bug, if the operator was actually meant to be called once, or misleading if done on purpose.
=== Noncompliant code example
[source,sql]
----
IF NOT ( NOT foo = 5 ) THEN -- Noncompliant
value := ++1; -- Noncompliant
END IF;
----
=== Compliant solution
[source,sql]
----
IF foo = 5 THEN -- Compliant
value := +1; -- Compliant
END IF;
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
=== on 1 Feb 2019, 22:47:11 Alexandre Gigleux wrote:
https://www.periscopedata.com/blog/sql-symbol-cheatsheet
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]