-
-
Notifications
You must be signed in to change notification settings - Fork 98
Support @abstract functions #388
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
Conversation
] | ||
|
||
|
||
def is_abstract_annotation_for_statement(statement: Tree, next_statement: Tree) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to do some extra checks in order to get the @abstract
annotation on the same line as func
/class_name
/class
.
Based on the reference to @abstract
here:
https://godotengine.org/article/dev-snapshot-godot-4-5-beta-2/
and looking at the GDScript style guide, it does seem like the @
annotations are supposed to be on the same line as what they're modifying.
blank_lines = _add_extra_blanks_due_to_next_statement( | ||
blank_lines, statement.data, surrounding_empty_lines_table | ||
) | ||
is_first_annotation = len(context.annotations) == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to refactor this function a bit to get around:
lint: commands[0]> pylint -rn -j0 setup.py gdtoolkit/ tests/ --rcfile=pylintrc
************* Module gdtoolkit.formatter.block
gdtoolkit/formatter/block.py:21:0: R0914: Too many local variables (16/15) (too-many-locals)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done, thanks!
Closes #387