Skip to content

Parentheses around condition in if with 'is not' drops the not keyword #284

Description

@portlek

When formatting code with parentheses around the condition, is not is incorrectly converted to is, dropping the not keyword.

Input:

func _test(test: Variant) -> void:
    if (test is not Array):
        return

Output:

func _test(test: Variant) -> void:
	if (test is Array):
		return

Expected:
is not should remain is not regardless of parentheses.

Note:
This only happens when the condition is wrapped in parentheses. Without parentheses, is not formats correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions