PR 1/4: Remove trailing whitespace from all script files#28
Open
StrongWind1 wants to merge 1 commit intoCompassSecurity:mainfrom
Open
PR 1/4: Remove trailing whitespace from all script files#28StrongWind1 wants to merge 1 commit intoCompassSecurity:mainfrom
StrongWind1 wants to merge 1 commit intoCompassSecurity:mainfrom
Conversation
Run PSScriptAnalyzer with -Fix to automatically remove 695 instances of trailing whitespace across all .psm1 and .ps1 files. Rule: PSAvoidTrailingWhitespace (Information) No functional changes — whitespace-only diff.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Branch:
fix/trailing-whitespaceBase:
mainHey there! This is the first of four small PRs to tidy up some things I noticed while running PSScriptAnalyzer against the codebase. I split everything into separate PRs to keep reviews manageable, and this one is the simplest so it can be merged on its own whenever you're ready.
What this does
Removes 695 instances of invisible trailing spaces and tabs from line endings across all 16
.psm1and.ps1files. Nothing else changes. The diff is 715 lines in, 715 lines out, all whitespace only.I used PSScriptAnalyzer's built in auto fix:
Super safe change. The tool just strips trailing whitespace and nothing else. No functional code was touched.
PSScriptAnalyzer is Microsoft's official static analysis and linting tool for PowerShell. Think of it as the equivalent of ruff for Python or ESLint for JavaScript. It ships with the VS Code PowerShell extension and checks scripts against 75 built in best practice rules covering code quality, naming conventions, security, compatibility, and formatting.
I ran it with all rules enabled and all severity levels (Error, Warning, Information) to get a full picture. This PR takes care of the most common finding, and the rest are covered in the follow up PRs.
This is PR 1 of 4 and ideally should be merged first. The other three PRs are stacked on top of this one:
Each PR builds on the previous one, so merging them in order keeps everything clean and conflict free. However, you can cherry pick individual commits if you would like.
Thanks for taking a look!