-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up-to-date .NET code quality analyzers #6434
Changes from all commits
f638e2a
a5cf8b6
a69c2e0
1f604fd
a91fef2
f24f397
b531e25
3887b9b
b723add
2b68a6a
ab9552b
a80a4be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,17 @@ | |
<AdditionalFiles Include="$(MSBuildThisFileDirectory)CodeAnalysis\BannedSymbols.txt" /> | ||
</ItemGroup> | ||
<PropertyGroup Label="Code Analysis"> | ||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)CodeAnalysis\osu-framework.ruleset</CodeAnalysisRuleSet> | ||
<AnalysisMode>Default</AnalysisMode> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually I tested |
||
<AnalysisModeDesign>Default</AnalysisModeDesign> | ||
<AnalysisModeDocumentation>Recommended</AnalysisModeDocumentation> | ||
<AnalysisModeGlobalization>Recommended</AnalysisModeGlobalization> | ||
<AnalysisModeInteroperability>Recommended</AnalysisModeInteroperability> | ||
<AnalysisModeMaintainability>Recommended</AnalysisModeMaintainability> | ||
<AnalysisModeNaming>Default</AnalysisModeNaming> | ||
<AnalysisModePerformance>Minimum</AnalysisModePerformance> | ||
<AnalysisModeReliability>Recommended</AnalysisModeReliability> | ||
<AnalysisModeSecurity>Default</AnalysisModeSecurity> | ||
<AnalysisModeUsage>Default</AnalysisModeUsage> | ||
</PropertyGroup> | ||
<PropertyGroup Label="NuGet"> | ||
<Authors>ppy Pty Ltd</Authors> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ public static void VerifyZeroDiagnostics(this GeneratorDriverRunResult runResult | |
.Where(d => d.Severity == DiagnosticSeverity.Error) | ||
.ToArray(); | ||
|
||
if (compilationDiagnostics.Any() || generatorDiagnostics.Any()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see this rule as controversial. As a non-English speaker, |
||
if (compilationDiagnostics.Length > 0 || generatorDiagnostics.Length > 0) | ||
{ | ||
var sb = new StringBuilder(); | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -121,7 +121,7 @@ protected void Filter() | |||||
private void performFilter() | ||||||
{ | ||||||
string[] terms = (searchTerm ?? string.Empty).Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To avoid the unnecessary allocation. Not related to this PR, but noticed it while reading through it. Wanna include it in this PR while you are at it?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah surprisingly, there isn't a single rule for switching from collection parameter to singleton. CA1861 is about using collections more efficiently. |
||||||
matchSubTree(this, terms, terms.Any(), allowNonContiguousMatching); | ||||||
matchSubTree(this, terms, terms.Length > 0, allowNonContiguousMatching); | ||||||
} | ||||||
|
||||||
private bool matchSubTree(Drawable drawable, IReadOnlyList<string> searchTerms, bool searchActive, bool nonContiguousMatching) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are covered in CA1304.