Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow CHECK keyword in begin of routines #1097

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

alezhu
Copy link

@alezhu alezhu commented Jan 17, 2023

Resolve #1095

Comment on lines +161 to +164
************************************************************************
* Copyright (c) 2023 by Alexandr Zhuravlev
* MIT License
* https://github.com/alezhu/abapOpenChecks/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git keeps the history

you can choose to contribute under the license terms, I dont want to add multiple license parts

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excuse me, but I do not understand. Do you mean that I should remove those 3 lines?

Copy link
Collaborator

@pcf0 pcf0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +226 to +228
WHEN 'CLEAR'
OR 'FREE'
OR 'REFRESH'.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WHEN 'CLEAR'
OR 'FREE'
OR 'REFRESH'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually clear the exporting parameters anyway and then check the importing parameters .

Comment on lines +237 to +240
WHEN 'DESCRIBE'
OR 'GET'
OR 'INCLUDE'
OR 'ASSIGN'.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WHEN 'DESCRIBE'
OR 'GET'
OR 'INCLUDE'
OR 'ASSIGN'.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CHECK outside of loop (CHECK 02) should be more smart
4 participants