Enable SA1014, SA1015 - #25023
Enable SA1014, SA1015#25023xtqqczze wants to merge 2 commits into
SA1014, SA1015#25023Conversation
|
Such rules slow down compilation more than they benefit. I suggest closing this PR. |
|
These rules are enabled in dotnet/runtime repo. No performance issues have been reported. |
|
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. |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
There was a problem hiding this comment.
Pull request overview
Enables two StyleCop analyzer rules (SA1014/SA1015) to enforce consistent spacing around generic type brackets across the C# codebase.
Changes:
- Set
SA1014andSA1015severities towarningin.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. |
SA1014: Opening generic brackets should not be preceded by a space (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1014.md)SA1015: Closing generic bracket should be followed by a space (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1015.md)