Skip to content

Enable SA1014, SA1015 - #25023

Open
xtqqczze wants to merge 2 commits into
PowerShell:masterfrom
xtqqczze:SA1014
Open

xtqqczze wants to merge 2 commits into
PowerShell:masterfrom
xtqqczze:SA1014

Conversation

@xtqqczze

Copy link
Copy Markdown
Contributor

@iSazonov

Copy link
Copy Markdown
Collaborator

Such rules slow down compilation more than they benefit. I suggest closing this PR.

@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Review - Needed The PR is being reviewed label Oct 12, 2025
@xtqqczze

Copy link
Copy Markdown
Contributor Author

These rules are enabled in dotnet/runtime repo. No performance issues have been reported.

@iSazonov

Copy link
Copy Markdown
Collaborator

Each rule increases compilation time and requires more resources for the IDE. Therefore, there is no need to try to include as many rules as possible. It is better to include the most important ones, those that protect against non-obvious errors.

@xtqqczze
xtqqczze marked this pull request as draft October 18, 2025 13:19
@xtqqczze
xtqqczze marked this pull request as ready for review October 18, 2025 14:18
@xtqqczze

Copy link
Copy Markdown
Contributor Author

Each rule increases compilation time and requires more resources for the IDE. Therefore, there is no need to try to include as many rules as possible. It is better to include the most important ones, those that protect against non-obvious errors.

Without enabling rules, we will see rule violations introduced, for example 42e86f6, 2376e28 both introduced violations of SA1015.

@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Oct 19, 2025
@microsoft-github-policy-service microsoft-github-policy-service Bot added the Review - Needed The PR is being reviewed label Oct 26, 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 6, 2026 23:53
@xtqqczze
xtqqczze requested a review from a team as a code owner May 6, 2026 23:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Enables two StyleCop analyzer rules (SA1014/SA1015) to enforce consistent spacing around generic type brackets across the C# codebase.

Changes:

  • Set SA1014 and SA1015 severities to warning in .globalconfig.
  • Fixed newly-enforced generic spacing violations in command completion code.
  • Reformatted a few generic-typed collection initializers in a test file to comply with the new spacing rules.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
test/xUnit/csharp/test_RemoteHyperV.cs Reformats generic-typed list initializers to comply with SA1014/SA1015.
src/System.Management.Automation/engine/CommandCompletion/CompletionCompleters.cs Fixes generic spacing violations (space after > and no space before <).
.globalconfig Enables SA1014/SA1015 by setting severities to 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.

3 participants