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

Logic for checking if an API is commented out or not is flawed #66

Open
nikkothari22 opened this issue Sep 18, 2024 · 0 comments
Open

Comments

@nikkothari22
Copy link
Member

The logic checks that before the @frappe.whitelist string are there an equal number of single/double quotes, or comment blocks (opening and closing) or not.

This fails when a comment might have an ' or " but no closing tag. (for example: the comment could be like:

Need to check the customer's ID

This would cause the API to be regarded as being inside a comment.

Possible solution: do not try to guess if the code is inside a comment or not - maybe have a flag that can tell the users that the API might be commented out, but still show the API on the UI. Or only test for triple strings only, and leave the single/double quotes from the logic.

Reference:

def is_in_string_or_comment(file_content, index):

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

No branches or pull requests

1 participant