Skip to content

Enable PSAlignAssignmentStatement analyzer rule (OSOE-538) #21

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

Open
BenedekFarkas opened this issue Jan 17, 2023 · 2 comments · May be fixed by #51
Open

Enable PSAlignAssignmentStatement analyzer rule (OSOE-538) #21

BenedekFarkas opened this issue Jan 17, 2023 · 2 comments · May be fixed by #51
Assignees

Comments

@BenedekFarkas
Copy link
Member

BenedekFarkas commented Jan 17, 2023

Factored out from #16.

PSAlignAssignmentStatement: The authors recommend this for readability and the auto-formatting in VS Code takes care of this when powershell.codeFormatting.alignPropertyValuePairs is enabled.

Jira issue

@github-actions github-actions bot changed the title Enable PSAlignAssignmentStatement analyzer rule Enable PSAlignAssignmentStatement analyzer rule (OSOE-538) Jan 17, 2023
@0liver
Copy link
Contributor

0liver commented Jan 17, 2023

We don't align assignments in any other language we code in, so what would be the incentive to do it for PS?

@BenedekFarkas
Copy link
Member Author

BenedekFarkas commented Jan 17, 2023

Readability.
In C#, this mostly would mostly apply to object/collection initialization, but it's not that frequent (I don't know if there's an option to do the same, but I haven't checked either).
For PS scripts, this is very common - multiple instances (with up to 6-8 parameters) in a script of even just a couple dozen lines due to parameter splatting.

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