From Relational Operator to Predicate Function
Open
@lucasborin is already working on this.
Since May 14, 2021.
style guide
- Dominant language
- ABAP
- Stars
- 435
- Forks
- 77
- PR merge metrics
- No merged PRs in 30d
Description
How about a new check to convert a relational operator to a predicate function?
| Relational Operator | Predicate Function |
|---|---|
| o1 CO o2 | NOT contains_any_not_of( val = o1 sub = o2 ) |
| o1 CN o2 | contains_any_not_of( val = o1 sub = o2 ) |
| o1 CA o2 | contains_any_of( val = o1 sub = o2 ) |
| o1 NA o2 | NOT contains_any_of( val = o1 sub = o2 ) |
| o1 CS o2 | contains( val = to_upper( o1 ) sub = to_upper( o2 ) ) |
| o1 NS o2 | NOT contains( val = to_upper( o1 ) sub = to_upper( o2 ) ) |
Source: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abencontains_functions.htm
Most of the non-ABAP developers do not understand the ABAP-specific relational operators.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.