Skip to content

[formatter] Comment to let formatter ignore contents #2151

@sharpchen

Description

@sharpchen

Summary of the new feature

A common feature of formatter is to ignore formatting for rest of lines/range of lines with special comments.
I propose this feature because formatting rules in pssa are rather bold, you can't get a finer control on the style, so ignoring certain part can save my code from being messed up.

# ignore a range of lines

# pssa: ignore format start
echo foo
echo bar
# pssa: ignore format end

# ignore the rest of lines

# pssa: ignore format
echo foo

Proposed technical implementation details (optional)

What is the latest version of PSScriptAnalyzer at the point of writing

I don't know, I use powershell-editor-services

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