Skip to content

Enable SA1028: Code should not contain trailing whitespace#25959

Open
xtqqczze wants to merge 1 commit into
PowerShell:masterfrom
xtqqczze:SA1028
Open

Enable SA1028: Code should not contain trailing whitespace#25959
xtqqczze wants to merge 1 commit into
PowerShell:masterfrom
xtqqczze:SA1028

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented Sep 2, 2025

@xtqqczze xtqqczze marked this pull request as draft September 2, 2025 18:28
@xtqqczze xtqqczze marked this pull request as ready for review September 2, 2025 18:28
@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Sep 3, 2025
@iSazonov
Copy link
Copy Markdown
Collaborator

iSazonov commented Sep 3, 2025

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@iSazonov
Copy link
Copy Markdown
Collaborator

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@iSazonov
Copy link
Copy Markdown
Collaborator

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@iSazonov
Copy link
Copy Markdown
Collaborator

@daxian-dbw Could you please approve/merge the style PR?

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Review - Needed The PR is being reviewed label Oct 29, 2025
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

Copilot AI review requested due to automatic review settings May 10, 2026 23:00
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables StyleCop analyzer rule SA1028 (no trailing whitespace) and updates existing C# sources to remove trailing whitespace so the rule can be enforced going forward.

Changes:

  • Set dotnet_diagnostic.SA1028.severity to warning in .globalconfig.
  • Remove trailing whitespace (including whitespace-only blank lines) across touched C# files in engine, remoting, parser, help, and test tooling.

Reviewed changes

Copilot reviewed 1 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
test/tools/WebListener/Controllers/CompressionController.cs Removes trailing whitespace in controller actions.
test/tools/NamedPipeConnection/src/code/NamedPipeConnection.cs Removes trailing whitespace in comments/blank lines.
src/System.Management.Automation/help/UpdateHelpCommand.cs Removes trailing whitespace in cmdlet logic/comments.
src/System.Management.Automation/help/HelpNotFoundException.cs Removes trailing whitespace in attributes/blank lines.
src/System.Management.Automation/help/HelpCommands.cs Removes trailing whitespace in XML doc comment.
src/System.Management.Automation/help/HelpCategoryInvalidException.cs Removes trailing whitespace and normalizes parameter line.
src/System.Management.Automation/engine/remoting/server/serverremotesession.cs Removes trailing whitespace in DISCPowerShellConfiguration call.
src/System.Management.Automation/engine/remoting/fanin/WSManTransportManager.cs Removes trailing whitespace in comment.
src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs Removes whitespace-only blank line in enum.
src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs Removes whitespace-only blank line in SSH process logic.
src/System.Management.Automation/engine/remoting/commands/SuspendJob.cs Removes trailing whitespace in conditional.
src/System.Management.Automation/engine/remoting/commands/PushRunspaceCommand.cs Removes trailing whitespace around overridden property braces.
src/System.Management.Automation/engine/remoting/commands/InvokeCommandCommand.cs Removes trailing whitespace in accessors/comments.
src/System.Management.Automation/engine/remoting/client/ThrottlingJob.cs Removes whitespace-only blank line.
src/System.Management.Automation/engine/remoting/client/Job2.cs Removes trailing whitespace in Obsolete attribute line.
src/System.Management.Automation/engine/remoting/client/Job.cs Removes trailing whitespace in Obsolete attribute line.
src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs Removes whitespace-only blank lines within type inference visitors.
src/System.Management.Automation/engine/parser/ConstantValues.cs Removes trailing whitespace in conditional.
src/System.Management.Automation/engine/MshCommandRuntime.cs Removes whitespace-only blank line before comment block.
src/System.Management.Automation/engine/Modules/GetModuleCommand.cs Removes whitespace-only blank line in Dispose.
src/System.Management.Automation/engine/hostifaces/PowerShellProcessInstance.cs Removes whitespace-only blank line in Dispose.
src/System.Management.Automation/engine/hostifaces/Connection.cs Removes whitespace-only blank line in property region.
.globalconfig Enables SA1028 as a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants