-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Formatter adds extraneous newlines after annotations above functions #267
Comments
Well, looks like |
Hi I'm a GdUnit4 user and I'd like to fix this to declutter my parameterized tests. I'd appreciate some guidance in the right direction since it seems to have missed the 4.2 milestone from earlier this year. Here's an example of what my tests are formatted to look likeclass_name DialogueManagerSanityTest
extends GdUnitTestSuite
const SRC_DIALOGUE_GROUP = preload("res://test/addons/dialogue_manager/src_dialogue_group.tres")
@warning_ignore("unused_parameter")
func test_pause_keys_are_sorted(
line: DialogueLine, test_parameters: Array = _get_all_dialogue_lines()
) -> void:
assert_bool(Arrays.is_sorted(line.pauses.keys())).is_true()
@warning_ignore("unused_parameter")
func test_inline_mutations_are_sorted(
line: DialogueLine, test_parameters: Array = _get_all_dialogue_lines()
) -> void:
assert_bool(Arrays.is_sorted(line.inline_mutations)).is_true()
static func _get_all_dialogue_lines() -> Array:
var result: Array = []
for dialogue_resource in SRC_DIALOGUE_GROUP.load_all():
for data in dialogue_resource.lines.values():
result.push_back([DialogueLine.new(data)])
return result
Does this mean the parser needs to be changed, not the formatter? Could you please explain this a little more so I can try my hand at a fix? |
It's fixed in |
Currently, when a function has an annotation such as
@warning_ignore
written above it, gdformat will add newlines in between the function and the annotation.Example input (which I would expect to be largely unchanged):
Current output:
The text was updated successfully, but these errors were encountered: