rspec/rules/S2284/rpg/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?
Free-format syntax is preferred because it is clearer, easier to write, and easier for newcomers to the language than fixed-format syntax.
=== Noncompliant code example
[source,rpg]
----
C IF A > 10
C EVAL B = 1
C ENDIF
----
=== Compliant solution
[source,rpg]
----
/free
if A > 10;
B = 1;
endif;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Convert this calculation block to free-form syntax.
'''
== Comments And Links
(visible only on this page)
=== on 15 Dec 2014, 13:46:44 Ann Campbell wrote:
assigned to you for approval
=== on 15 Dec 2014, 14:17:18 Pierre-Yves Nicolas wrote:
Looks good to me.
I guess that rule should be fired for a block of lines of code rather than for individual lines. If that's the case, then we may have to use a linear remediation function.
=== on 15 Dec 2014, 14:49:53 Ann Campbell wrote:
Linear with offset based on the number of lines? What do you think [~pierre-yves.nicolas]?
5 min + 5min/line ?
For the noncompliant code example, that works out to 20min...
=== on 15 Dec 2014, 16:59:31 Pierre-Yves Nicolas wrote:
Ok. We should probably update the message to make it clear that the issue is on a block.
endif::env-github,rspecator-view[]