Skip to content

Ensure that conditional operators are always at the start of lines in multi-line expressions #264

Description

@NathanLovato

From the official style guide, the else keyword or and keyword in long expressions should be at the start of the line. This task is about verifying this works reliably and along the way thinking about/collecting a couple patterns from which to derive rules for placement.

var angle_degrees = 135
var quadrant = (
		"northeast" if angle_degrees <= 90
		else "southeast" if angle_degrees <= 180
		else "southwest" if angle_degrees <= 270
		else "northwest"
)

var position = Vector2(250, 350)
if (
		position.x > 200 and position.x < 400
		and position.y > 300 and position.y < 400
):
	pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions