Skip to content

Fix for PSUseConsistantWhiteSpace when using statement is present - #2091

Merged
Andy Jordan (andyleejordan) merged 6 commits into
PowerShell:mainfrom
AlexandraDorey:FixUsing
Apr 4, 2025
Merged

Fix for PSUseConsistantWhiteSpace when using statement is present#2091
Andy Jordan (andyleejordan) merged 6 commits into
PowerShell:mainfrom
AlexandraDorey:FixUsing

Conversation

@AlexandraDorey

@AlexandraDorey AlexandraDorey-Magnet (AlexandraDorey) commented Apr 1, 2025

Copy link
Copy Markdown
Contributor

PR Summary

The addition of an using statement can cause the PSUseConsistant white space to fail due to how the InternalVisit of the UsingStatementAst is implemented in a slightly different way than other ASTs. See issue 2089 for more details.

PR Checklist

@AlexandraDorey

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey cool, good debugging. Read through your issue, I think you're right and this makes sense. Just approved the tests workflow.

@AlexandraDorey AlexandraDorey-Magnet (AlexandraDorey) changed the title WIP - Fix for PSUseConsistantWhiteSpace when using statement is present Fix for PSUseConsistantWhiteSpace when using statement is present Apr 1, 2025
Comment thread NuGet.Config Outdated
Comment thread Tests/Rules/UseConsistentWhitespace.tests.ps1 Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, well done

@AlexandraDorey

AlexandraDorey-Magnet (AlexandraDorey) commented Apr 3, 2025

Copy link
Copy Markdown
Contributor Author

Fixed the nits up, I'm not super familiar with github but I assume I can merge my commits into one commit when the PR merges or should I do that in by branch first? Otherwise should be good to merge once the tests run again :)

@andyleejordan
Andy Jordan (andyleejordan) enabled auto-merge (squash) April 4, 2025 00:51
@andyleejordan

Copy link
Copy Markdown
Member

Sure can!

@andyleejordan
Andy Jordan (andyleejordan) merged commit 2287a13 into PowerShell:main Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants