Skip to content

Invoke-Formatter do nothing :( #2012

Closed
Closed
@hitriyvalenok

Description

@hitriyvalenok

I need to inline variable assignments only. Nothing more. For example, I have:

$var = @{

}

Exptected:

$var = @{}

Full example:

$customConfig = @{
    Rules = @{
        PSUseConsistentIndentation = @{
            Enable = $false
        }
        PSUseConsistentWhitespace = @{
            Enable = $false
        }
        PSAlignAssignmentStatement = @{
            Enable = $true
            CheckHashtable = $false
        }
    }
}
$code = @'
$var = @{

}
'@
Invoke-Formatter -ScriptDefinition $code -Settings $customConfig

But the cmdlet does nothing for me. It returns the code I passed without a tiny change as I've just asked to return $code back untouched. What I'm doing wrong?

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