rspec/rules/S1676/abap/rule.adoc

49 lines
1.0 KiB
Plaintext
Raw Normal View History

== Why is this an issue?
2021-04-28 16:49:39 +02:00
For readability, SAP recommends that asterisks (``++*++``) only be used to comment out header lines and code. Commentary should be commented using a double quote (``++"++``)
=== Noncompliant code example
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,abap]
2021-04-28 16:49:39 +02:00
----
* GAC - 13 June 13 - output user data
* WRITE: / 'Firstname'.
----
=== Compliant solution
2021-04-28 16:49:39 +02:00
2022-02-04 17:28:24 +01:00
[source,abap]
2021-04-28 16:49:39 +02:00
----
" GAC - 13 June 13 - output user data
* WRITE: / 'Firstname'.
----
=== Exceptions
2021-04-28 16:49:39 +02:00
This rule ignores code that is included in a commentary block and commented as commentary.
[source,abap]
2021-04-28 16:49:39 +02:00
----
" This is a commentary block. It could go on for a number of lines.
" As we see in the code sample below...
" WRITE: / 'Firstname'.
" It would have been better to comment the line above as code (i.e. with an asterisk)
" but not doing so is accepted.
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Use a double-quote to mark this comment line instead of an asterisk
endif::env-github,rspecator-view[]