Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSAlignAssignmentStatement: Ignore hashtables with a single key-value pair #1986

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liamjpeters
Copy link
Contributor

PR Summary

Hashtables with a single key-value pair should be ignored by PSAlignAssignmentStatement as there is nothing to align.

There are other rules that handle whitespace around operators etc which can handle formatting according to the users preference.

Currently:

Invoke-Formatter -ScriptDefinition "@{'Key'='Value'}" -Settings @{
    Rules = @{
        PSAlignAssignmentStatement = @{
            Enable = $true
            CheckHashtable = $true
        }
    }
}

Results in:

@{'Key' ='Value'}

Note the space added after the hashtable key

Resolves #1979

PR Checklist

…g on a single line, and not checked for violations.
@liamjpeters
Copy link
Contributor Author

My git-foo is not strong so this is a re-raise of #1983 where the full test checks were completed and passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adds whitespace around operators with whitespaceAroundOperator set to false in some cases
1 participant