Linter: doesn't respect indent size
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start at src/linter/rules/max_line_length.rs:24 and trace how the formatter reads indent_size. Compare the linter's indentation calculation with the provided GDScript example using indent_size 2. Done when the linter no longer flags that line while preserving max-line-length behavior for other indentation settings.
Written by the indexing model from the issue text.
Description
After changing indent_size to 2 in my .editorconfig, I noticed that the formatter wouldn't format certain lines that the linter would flag. It looks like the max line length calculation of the linter assumes the indent size is 4 rather than using the same indent size config that the formatter uses.
Here's a basic GDScript example that the linter flags as too long even though it should be within the max line length limit. This is supported by the fact that the formatter does not format the line since it respects the indent_size.
func test() -> Array[String]:
# This line is incorrectly flagged by the linter when indent_size is 2.
return ["echo", "echo", "echo", "echo", "echo", "echo", "echo", "echo", "echo", "echo", "echooo"]
The offending line looks to be https://github.com/GDQuest/GDScript-formatter/blob/29e2dc993b2ed746f50dae594357e020f7ccc3b9/src/linter/rules/max_line_length.rs#L24
The indent is increments by a hard-coded 4.
- Dominant language
- Rust
- Stars
- 458
- Forks
- 40
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GDQuest/GDScript-formatter
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
GDQuest/GDScript-formatter#354 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
GDQuest/GDScript-formatter#353 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 63/100
GDQuest/GDScript-formatter#348 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
GDQuest/GDScript-formatter#341 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
GDQuest/GDScript-formatter#339 ·
All issues in GDQuest/GDScript-formatter
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100