GDQuest / GDQuest/GDScript-formatter

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

Open
#350 3 comments 0 reactions 1 assignee Claimed by @NathanLovato View on GitHub
Dominant language
Rust
Stars
455
Forks
39
Avg merge
1d 15h
Merged PRs (30d)
4

Description

## Sample code

```gd
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

```gd
# 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

```gd
# 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`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.