rspec/rules/S1728/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

75 lines
1.6 KiB
Plaintext

== Why is this an issue?
Shared coding conventions allow teams to collaborate efficiently. For maximum readability, this rule checks that the levels, names and PICTURE clauses for all items of the same level and which are subordinate to the same item start in the same column.
=== Noncompliant code example
[source,cobol]
----
01 ZONE1.
03 ZONE2 PIC X(10).
03 ZONE3 PIC X(10). *> Noncompliant; name out of line
03 ZONE4 PIC X(10). *> Noncompliant; level out of line
03 ZONE5 PIC X(10). *> Noncompliant; PIC out of line
----
=== Compliant solution
[source,cobol]
----
01 ZONE1.
03 ZONE2 PIC X(10).
03 ZONE3 PIC X(10).
03 ZONE4 PIC X(10).
03 ZONE5 PIC X(10).
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
* Edit this set of data item declarations with the same level so that all (levels|"PIC" clauses|names) start in the same column.
* Level 01 items should begin in column X
=== Parameters
.level_01_column
****
The column in which level 01 items should start. Leave blank to allow level 01 items to start in any column
****
.check_name_alignment
****
Whether to check the alignment of names for items of the same level.
****
.check_level_alignment
****
Whether to check the alignment of level indicators for items of the same level.
****
.check_pic_alignment
****
Whether to check the alignment of "PIC" clauses for items of the same level.
****
'''
== Comments And Links
(visible only on this page)
=== is duplicated by: S1730
=== is duplicated by: S1802
endif::env-github,rspecator-view[]