_init() does not wrap like other functions + unwanted formatting case for a function call chain
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 483
- フォーク
- 40
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
GDQuest/GDScript-formatter のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
GDQuest/GDScript-formatter#369 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
GDQuest/GDScript-formatter#365 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
GDQuest/GDScript-formatter#366 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
GDQuest/GDScript-formatter#360 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
GDQuest/GDScript-formatter#354 · コメント 2 件 ·
GDQuest/GDScript-formatter の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
gitbutlerapp/gitbutler#16982 ·
メンテナーはふだん 1 日以内に返信
-
priority: high status: new topic: ga4gh-sdk type: docs type: maintenance workload: minutes
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
C-bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rust-lang/rust-clippy#17976 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
aaif-goose/goose#13327 ·
メンテナーはふだん 1 日以内に返信
-
llm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信