Skip to content

PSAvoidTrailingWhitespace should ignore empty lines indented to match the current block #1033

Open
@poshcodebear

Description

@poshcodebear

Currently, PSAvoidTrailingWhitespace checks all lines for trailing whitespace, even when that line is effectively empty and the "trailing" whitespace is actually leading whitespace for the current indentation level. If the recommended action is taken (remove the whitespace), then adding new code in those spots requires re-indenting that spot to the current code indentation level.

I propose that it should respect the current indentation level for an empty line and not generate a note for those lines, as long as they match the indentation of the current block of code.

What is the latest version of PSScriptAnalyzer at the point of writing
1.17.1, shipping with the vscode-powershell extension version 1.8.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions