rspec/rules/S1307/cobol/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

63 lines
1.4 KiB
Plaintext

== Why is this an issue?
It is fairly normal for COBOL development teams to decide to work either with sections or with paragraphs and to make this choice a standard.
When sections are used, it is also normal to define another standard: "End every section definition with an empty paragraph definition, or a paragraph containing only a terminating statement".
This empty paragraph can then be jumped to with a ``++GO TO++`` statement to stop the execution of a section.
Accepted terminating statements in the otherwise-empty ending paragraph are: ``++EXIT++``, ``++EXIT PROGRAM++``, ``++STOP RUN++``, and ``++GO BACK++``.
=== Noncompliant code example
In this example, an empty paragraph is missing at the end of the first section definition.
[source,cobol]
----
FIRST_SECTION SECTION.
...
SECOND_SECTION SECTION.
...
SECOND_SECTION_END.
----
=== Compliant solution
[source,cobol]
----
FIRST_SECTION SECTION.
...
FIRST_SECTION_END.
SECOND_SECTION SECTION.
...
SECOND_SECTION_END.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Add an empty paragraph at the end of this "XXXX" section.
'''
== Comments And Links
(visible only on this page)
=== relates to: S1594
=== on 20 Nov 2013, 12:34:24 Dinesh Bolkensteyn wrote:
I am wondering how this could conflict with COBOL.UnusedParagraphOrSectionLabelCheck.
endif::env-github,rspecator-view[]