Skip to content

Preserve indentation when checking trailing-whitespace #403

@danikaze

Description

@danikaze

When you have a function with different "blocks" of code like this ( symbolizes the tabs like in the godot editor)

func ():
→ statement1
→ statement2
→
→ if condition:
→ → do this
→ else:
→ → do that
→ → do that too
→ →
→ → also this
→
→ continue here

where there are empty lines (before the if and after the if) to make the code more readable, the current whitespace checks will require those empty line to be actually empty, while it makes more sense to preserve the indentation of the function or it will look like the function code has been ended.

Request: To add this behavior or a configuration option for the trailing-whitespace rule accepting this new option in gdlint. Something like mode: absolute | indented or similar, to be able to preserve the current behavior and the new behavior.

The same goes for gdformat, so empty lines inside certain level of indentation are not removed, but left with the correct indentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions