rspec/rules/S1280/cobol/rule.adoc

35 lines
695 B
Plaintext
Raw Normal View History

2021-04-28 16:49:39 +02:00
Paragraphs, sections and statements must be correctly indented for better code readability.
2021-04-28 16:49:39 +02:00
== Noncompliant Code Example
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
IDENTIFICATION DIVISION.
PROGRAM-ID. foo.
PROCEDURE DIVISION.
IF "foo" = "bar" THEN
DISPLAY "foo = bar!" *> Noncompliant
ELSE
DISPLAY "foo <> bar!". *> Noncompliant
END PROGRAM foo.
----
2021-04-28 16:49:39 +02:00
== Compliant Solution
2022-02-04 17:28:24 +01:00
[source,cobol]
2021-04-28 16:49:39 +02:00
----
IDENTIFICATION DIVISION.
PROGRAM-ID. foo.
PROCEDURE DIVISION.
IF "foo" = "bar" THEN
DISPLAY "foo = bar!"
ELSE
DISPLAY "foo <> bar!".
END PROGRAM foo.
----