WIP: Fix: PSUseConsistentWhitespace formatting for do-while, unary operators, and native commands by DrSkillIssue · Pull Request #2114 · PowerShell/PSScriptAnalyzer · GitHub
Skip to content

WIP: Fix: PSUseConsistentWhitespace formatting for do-while, unary operators, and native commands - #2114

Closed
Dr. Skill Issue (DrSkillIssue) wants to merge 5 commits into
PowerShell:mainfrom
DrSkillIssue:format-miss-keywords
Closed

Dr. Skill Issue (DrSkillIssue) wants to merge 5 commits into
PowerShell:mainfrom
DrSkillIssue:format-miss-keywords

Conversation

@DrSkillIssue

@DrSkillIssue Dr. Skill Issue (DrSkillIssue) commented Jun 17, 2025 •

Copy link
Copy Markdown

PR Summary

Fixes multiple whitespace formatting issues in PSUseConsistentWhitespace rule

Issues Fixed:

Changes Made:

Core Fixes:

  • Added FindKeywordAfterBraceViolations to handle keywords following closing braces
  • Enhanced unary operator detection and spacing logic in FindOperatorViolations
  • Fixed FindParameterViolations to skip whitespace inside string literals
  • Added comma pattern detection in FindSeparatorViolations for native command arguments
  • Added the additional keywords to openParenKeywordAllowList: Until, Do, Else, Catch, Finally

Tests Added:

  • Added test-cases for the above-mentioned changes.

PR Checklist

@DrSkillIssue Dr. Skill Issue (DrSkillIssue) changed the title Fix: #2095 - UseConsistentWhitespace formatting for do-while/do-until loops and unary operators WIP: Fix: #2095 - UseConsistentWhitespace formatting for do-while/do-until loops and unary operators Jun 17, 2025
@DrSkillIssue

Dr. Skill Issue (DrSkillIssue) commented Jun 17, 2025 •

Copy link
Copy Markdown
Author

@DrSkillIssue Dr. Skill Issue (DrSkillIssue) changed the title WIP: Fix: #2095 - UseConsistentWhitespace formatting for do-while/do-until loops and unary operators WIP: Fix: PSUseConsistentWhitespace formatting for do-while, unary operators, and native commands Jun 17, 2025
@bergmeister

Copy link
Copy Markdown
Collaborator

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.

2 participants