46 lines
672 B
Plaintext
46 lines
672 B
Plaintext
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.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,sql]
|
|
----
|
|
<<myBlockLabel1>>
|
|
BEGIN
|
|
NULL;
|
|
END; -- Noncompliant; this labeled loop has no ending label
|
|
/
|
|
|
|
BEGIN
|
|
NULL; -- Compliant; not a labeled block
|
|
END;
|
|
/
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
[source,sql]
|
|
----
|
|
<<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[]
|