_init() does not wrap like other functions + unwanted formatting case for a function call chain
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 483
- Fork
- 40
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GDQuest/GDScript-formatter
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
GDQuest/GDScript-formatter#369 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
GDQuest/GDScript-formatter#365 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
GDQuest/GDScript-formatter#366 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 58/100
GDQuest/GDScript-formatter#360 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
GDQuest/GDScript-formatter#354 · 2 commenti ·
Tutte le issue di GDQuest/GDScript-formatter
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
longbridge/gpui-kit#3795 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
saltnpepper97/halley#271 ·
I maintainer di solito rispondono entro 1 giorno
-
Remove the unused gh-aw agentic workflow setupForse già presa @AviAvni l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 3 giorni
-
bug stdlib
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 83/100
Sh1n1230/PunctuationToggle#308 ·
I maintainer di solito rispondono entro 1 giorno