Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@liamjpeters
Copy link
Contributor

PR Summary

Hashtables with a single key-value pair should be ignored byPSAlignAssignmentStatement 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=$trueCheckHashtable=$true        }    }}

Results in:

@{'Key'='Value'}

Note the space added after the hashtable key

Resolves#1979

PR Checklist

o-l-a-v reacted with rocket emoji
@liamjpeters
Copy link
ContributorAuthor

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

Copy link
Collaborator

@bergmeisterbergmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice to fix this undesired side effect in this case. the formatting rules have so many special oddities 😅

liamjpeters reacted with thumbs up emoji
Copy link
Member

@andyleejordanandyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks!

@andyleejordanandyleejordanenabled auto-merge (squash)February 19, 2025 18:24
…g on a single line, and not checked for violations.
@andyleejordanandyleejordanforce-pushed the#1979IgnoreHashtablesWithASingleKVP branch from57cb24b tod831fbaCompareFebruary 19, 2025 18:28
@andyleejordanandyleejordan merged commit20135fb intoPowerShell:mainFeb 19, 2025
4 checks passed
@liamjpetersliamjpeters deleted the #1979IgnoreHashtablesWithASingleKVP branchFebruary 21, 2025 11:50
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@andyleejordanandyleejordanandyleejordan approved these changes

@bergmeisterbergmeisterbergmeister approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Adds whitespace around operators withwhitespaceAroundOperator set to false in some cases

3 participants

@liamjpeters@andyleejordan@bergmeister

[8]ページ先頭

©2009-2025 Movatter.jp