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

55 lines
1.1 KiB
Plaintext

== Why is this an issue?
Even if there's no data to be returned from a procedure, each procedure should at least return a boolean to indicate when procedure execution failed, so callers can respond accordingly.
=== Noncompliant code example
[source,rpg]
----
D MyProc PI
D param1 10A const
/free
// do work...
return; // Noncompliant
/end-free
----
=== Compliant solution
[source,rpg]
----
D MyProc PI N
D param1 10A const
/free
// do work...
return *ON;
/end-free
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Return something from this procedure.
'''
== Comments And Links
(visible only on this page)
=== on 2 Apr 2015, 18:55:05 Ann Campbell wrote:
http://www.bmeyers.net/faqs/14-tips/32-rpg-iv-style?start=2
=== on 16 Apr 2015, 09:33:33 Pierre-Yves Nicolas wrote:
\[~ann.campbell.2] I would not activate this rule by default, especially with a critical severity.
endif::env-github,rspecator-view[]