Allow CHECK keyword in begin of routines#1097
Conversation
Also fix some old tests
Remove commented Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
…nto check_02_smarter
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
| ************************************************************************ | ||
| * Copyright (c) 2023 by Alexandr Zhuravlev | ||
| * MIT License | ||
| * https://github.com/alezhu/abapOpenChecks/ |
There was a problem hiding this comment.
git keeps the history
you can choose to contribute under the license terms, I dont want to add multiple license parts
There was a problem hiding this comment.
Excuse me, but I do not understand. Do you mean that I should remove those 3 lines?
pcf0
left a comment
There was a problem hiding this comment.
This test is certainly very subjective.
In my opinion, CHECK should not be allowed after the marked commands.
The exception states that CHECK may only check the precondition of the procedure. But these commands already "do" something and are not preconditions?
| WHEN 'CLEAR' | ||
| OR 'FREE' | ||
| OR 'REFRESH'. |
There was a problem hiding this comment.
| WHEN 'CLEAR' | |
| OR 'FREE' | |
| OR 'REFRESH'. |
There was a problem hiding this comment.
We usually clear the exporting parameters anyway and then check the importing parameters .
| WHEN 'DESCRIBE' | ||
| OR 'GET' | ||
| OR 'INCLUDE' | ||
| OR 'ASSIGN'. |
There was a problem hiding this comment.
| WHEN 'DESCRIBE' | |
| OR 'GET' | |
| OR 'INCLUDE' | |
| OR 'ASSIGN'. |
There was a problem hiding this comment.
'DESCRIBE' - for describe lines or get field type and then check it
'GET' - for GET PARAMETER for example and then check it
'ASSIGN' - for assign importing parameter of generic type and cast them to concret type or dereference ref and then check assigned structure field or check assigned table lines or some thing
'INCLUDE' - sometimes common checks in common include
There was a problem hiding this comment.
I agree with pcf0: In my opinion this goes against the spirit of only allowing CHECK at the start of routines. If you need to do things before you CHECK, then it's not the start of the routine anymore.
Resolve #1095