Skip to content

Formatter on/off comments within a code block can prevent the entire code block from wrapping #350

Description

@blabdouze

Sample code

func add_river_quad(v1: Vector3, v2: Vector3, v3: Vector3, v4: Vector3, y: float, v: float, reversed: bool) -> void:
	add_river_quad_two_heights(v1, v2, v3, v4, y, y, v, reversed)


func add_river_quad_two_heights(v1: Vector3, v2: Vector3, v3: Vector3, v4: Vector3, y1: float, y2: float, v: float, reversed: bool) -> void:
       pass

With line_width = 80

# Ok
func add_river_quad(
	v1: Vector3,
	v2: Vector3,
	v3: Vector3,
	v4: Vector3,
	y: float,
	v: float,
	reversed: bool,
) -> void:
	add_river_quad_two_heights(v1, v2, v3, v4, y, y, v, reversed)

# Not ok
func add_river_quad_two_heights(v1: Vector3, v2: Vector3, v3: Vector3, v4: Vector3, y1: float, y2: float, v: float, reversed: bool) -> void:
	pass

With line_width = 120

# Is OK
func add_river_quad(v1: Vector3, v2: Vector3, v3: Vector3, v4: Vector3, y: float, v: float, reversed: bool) -> void:
	add_river_quad_two_heights(v1, v2, v3, v4, y, y, v, reversed)

# Still not split into multiple lines
func add_river_quad_two_heights(v1: Vector3, v2: Vector3, v3: Vector3, v4: Vector3, y1: float, y2: float, v: float, reversed: bool) -> void:

Given the warning max-line-length:warning: Line is too long. Found 166 characters, maximum allowed is 120

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions