rspec/rules/S1280/cobol/rule.adoc
2022-02-04 16:28:24 +00:00

35 lines
695 B
Plaintext

Paragraphs, sections and statements must be correctly indented for better code readability.
== Noncompliant Code Example
[source,cobol]
----
IDENTIFICATION DIVISION.
PROGRAM-ID. foo.
PROCEDURE DIVISION.
IF "foo" = "bar" THEN
DISPLAY "foo = bar!" *> Noncompliant
ELSE
DISPLAY "foo <> bar!". *> Noncompliant
END PROGRAM foo.
----
== Compliant Solution
[source,cobol]
----
IDENTIFICATION DIVISION.
PROGRAM-ID. foo.
PROCEDURE DIVISION.
IF "foo" = "bar" THEN
DISPLAY "foo = bar!"
ELSE
DISPLAY "foo <> bar!".
END PROGRAM foo.
----