_init() does not wrap like other functions + unwanted formatting case for a function call chain
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 55/100
Rechercherichtung
Reproduce both cases with gdscript-formatter 0.27.0 using the default max_line_length of 100, then inspect the formatter paths for function signatures and chained calls. Add regression coverage for both examples; done means formatting preserves already-valid input or produces output that stays within the configured limit.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
With 0.27.0 and the default settings (max_line_length: 100, tabs), the formatter produces lines longer than 100 columns, which gdscript-formatter lint then refuses. In both cases below, the input already passes lint and the formatted output doesn't, so a project that runs --check and lint together can't satisfy both.
1. A wrapped function signature is re-joined into one line of 101–109 columns
This looks like #300 again. That issue's own example still reproduces on 0.27.0 (it stays on one 108-column line).
Input (passes lint):
const SHADER := "res://a.gdshader"
const FADE_S := 1.0
func _init(
node_name: String = "SkidMarks",
shader_path: String = SHADER,
fade_s: float = FADE_S,
) -> void:
name = node_name
gdscript-formatter --stdout output:
func _init(node_name: String = "SkidMarks", shader_path: String = SHADER, fade_s: float = FADE_S) -> void:
name = node_name
max-line-length:warning: Line is too long. Found 106 characters, maximum allowed is 100
Lengthening the last parameter shows that the signature stays on one line up to 109 columns and only wraps from 110.
2. A long argument to a chained call is pulled up onto a backslash-continued line
Input (passes lint, longest line 89 columns with tabs at 4):
func test_it() -> void:
assert_that(x).override_failure_message(
"this is a long failure message that goes on and on to push it beyond the limit %s" % x
).is_true()
Output:
func test_it() -> void:
assert_that(x) \
.override_failure_message("this is a long failure message that goes on and on to push it beyond the limit %s"
% x) \
.is_true()
max-line-length:warning: Line is too long. Found 121 characters, maximum allowed is 100
This may be related to #360. Here, though, the input already fits, and the output both exceeds the limit and splits the % operand onto a line with less indentation.
Expected: in both cases, output that stays within max_line_length, or at least keeps an input that already fits.
macOS arm64, gdscript-formatter 0.27.0 release binary.
- Vorherrschende Sprache
- Rust
- Sterne
- 483
- Forks
- 40
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus GDQuest/GDScript-formatter
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 72/100
GDQuest/GDScript-formatter#369 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
GDQuest/GDScript-formatter#365 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
GDQuest/GDScript-formatter#366 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 58/100
GDQuest/GDScript-formatter#360 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
GDQuest/GDScript-formatter#354 · 2 Kommentare ·
Alle Issues in GDQuest/GDScript-formatter
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
near/near-sdk-rs#1676 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
auto:producer auto:security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
fritzprix/libr-agent#2595 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:fs type:fix
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Tripstack-Corp/spyc#1002 ·
Maintainer antworten meist innerhalb von 1 Tag
-
github_actions security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
dekobon/big-code-analysis#1815 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Detail Bug] Request logs can be forged via control characters in fetch object keys (log injection)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
s2-streamstore/cachey#211 ·
Maintainer antworten meist innerhalb von 1 Tag