rspec/rules/S1730/rule.adoc

61 lines
1.7 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
Shared coding conventions allow teams to collaborate efficiently, and consistently indented code has a strong impact on readability. This rule checks that the following spacing conventions are followed:
* 01 level declaration should start in a specific column (8 by default)
* Subordinate data items must be indented from superior data items.
* In a file, all data item declarations having the same level should start in the same column
=== Noncompliant code example
2022-02-04 17:28:24 +01:00
[source,text]
----
01 StudentDetails.
05 StudentId PIC 9(7). *< Noncompliant: indented too far
05 StudentName.
07 FirstName PIC X(10).
07 MiddleInitial PIC X. *< Noncompliant
07 Surname PIC X(15).
05 DateOfBirth.
07 DayOfBirth PIC 99.
07 MonthOfBirth PIC 99.
07 YearOfBirth PIC 9(4). *< Noncomopliant
09 CourseCode PIC X(4). *< Noncompliant: not indented enough
----
=== Compliant solution
2022-02-04 17:28:24 +01:00
[source,text]
----
01 StudentDetails.
05 StudentId PIC 9(7).
05 StudentName.
07 FirstName PIC X(10).
07 MiddleInitial PIC X.
07 Surname PIC X(15).
05 DateOfBirth.
07 DayOfBirth PIC 99.
07 MonthOfBirth PIC 99.
07 YearOfBirth PIC 9(4).
09 CourseCode PIC X(4).
----
2022-01-25 18:36:46 +01:00
ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)
=== duplicates: S1728
=== on 14 May 2014, 13:24:07 Freddy Mallet wrote:
@Ann, I let you review this specification and then notify @Marie-Christine to be sure that is fits her needs.
=== on 8 Aug 2014, 19:23:40 Ann Campbell wrote:
rolled into RSPEC-1728
2022-01-25 18:36:46 +01:00
endif::env-github,rspecator-view[]