Skip to content

Linter: doesn't respect indent size #327

Closed

Description

@nathaniellam

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

.fold(0, |acc, ch| if ch == '\t' { acc + 4 } else { acc + 1 });

The indent is increments by a hard-coded 4.

Activity

  1. added theissue type on Aug 16, 2026
  2. NathanLovato commented on Aug 16, 2026

    @NathanLovato
    Contributor

    Thanks for the report. I've generally not put much attention on the linter itself yet (it's a community-contributed extra program), but definitely should take the time to make sure it respects the editor config and follows the same indent calculation as the formatter. Will do as time allows!

  3. changed the title [-]Linter doesn't respect indent size[/-] [+]Linter: doesn't respect indent size[/+] on Sep 11, 2026
  4. added a commit that references this issue on Sep 25, 2026
    1645da8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions