You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Standardize escaping of ! parameters: "Never" option? #31
I noticed there is no Never option available for this rule.
Is it truly required to escape parameters that match ABAP keywords? I have been removing these for some time without issue. Perhaps we could add a Never option?
I think adding "never" as a fourth option would be a good solution – or maybe it could be called "only to avoid syntax errors" or "almost never" :-)
Please let me know if you find more examples of parameter names that trigger syntax errors. Apart from "exporting", "changing" and "raising", ! is apparently also needed for "default", "optional" and "preferred" (and "default" would be a parameter name that I could even imagine to be used in real life). By contrast, "importing", "value" and "reference" work fine.
I think adding "never" as a fourth option would be a good solution – or maybe it could be called "only to avoid syntax errors" or "almost never" :-)
Please let me know if you find more examples of parameter names that trigger syntax errors. Apart from "exporting", "changing" and "raising", ! is apparently also needed for "default", "optional" and "preferred" (and "default" would be a parameter name that I could even imagine to be used in real life). By contrast, "importing", "value" and "reference" work fine.
Kind regards, Jörg-Michael
I would support either solution. "Never" should be sufficient; engineers would be already alerted to an issue with the parameter name due to the syntax error, so cleanup really shouldn't be necessary.
Activity
jmgrassau commentedon May 25, 2023
Hi Josh,
you're right, you can hardly find an example where this goes wrong. However, try this case (which is complete nonsense, of course) :
Kind regards,
Jörg-Michael
jelliottp commentedon May 25, 2023
Thanks for the example. So it seems importing/exporting/changing/returning/raising are the only cases where it's truly a syntax error.
Perhaps this could be one of the configuration options? Or become the behavior for
only if parameter name is ABAP wordsetting?jmgrassau commentedon May 26, 2023
Hi Josh,
I think adding "never" as a fourth option would be a good solution – or maybe it could be called "only to avoid syntax errors" or "almost never" :-)
Please let me know if you find more examples of parameter names that trigger syntax errors. Apart from "exporting", "changing" and "raising", ! is apparently also needed for "default", "optional" and "preferred" (and "default" would be a parameter name that I could even imagine to be used in real life). By contrast, "importing", "value" and "reference" work fine.
Kind regards,
Jörg-Michael
jelliottp commentedon May 26, 2023
I would support either solution. "Never" should be sufficient; engineers would be already alerted to an issue with the parameter name due to the syntax error, so cleanup really shouldn't be necessary.
jmgrassau commentedon May 30, 2023
Hi Josh,
okay, in the next release, this option will look as follows:
The example now shows all critical keywords that I am aware of:
Kind regards,
Jörg-Michael
enhance EscapeChar...Rule w. option 'only to avoid syntax errors' (SA…
enhance EscapeChar...Rule w. option 'only to avoid syntax errors' (#31)
jmgrassau commentedon Jun 6, 2023
Hi Josh,
this new option is now released with version 1.3.0!
Kind regards,
Jörg-Michael