rspec/rules/S2451/plsql/rule.adoc

46 lines
672 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Labeled blocks are useful, especially when the code is badly indented, to match the begin and end of each block. This check detects labeled blocks which are missing an ending label.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,sql]
2021-04-28 16:49:39 +02:00
----
<<myBlockLabel1>>
BEGIN
NULL;
END; -- Noncompliant; this labeled loop has no ending label
/
BEGIN
NULL; -- Compliant; not a labeled block
END;
/
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,sql]
2021-04-28 16:49:39 +02:00
----
<<myBlockLabel2>>
BEGIN
NULL;
END myBlockLabel2;
/
BEGIN
NULL;
END;
/
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::message.adoc[]
endif::env-github,rspecator-view[]