Repository navigation
Use NetAnalyzers from SDK instead of FxCopAnalyzers - #30138
Conversation
caace89 to
f8a3736
Compare
f8a3736 to
09068aa
Compare
4a7aa37 to
ea93e93
Compare
|
There CA1310 violations like: Do you want me to pass a StringComparison.Ordinal, or StringComparison.Invariant, or disable the rule? I'm not sure why the |
…s. Due to value boxing, this call will always return false.
Pilchie
left a comment
There was a problem hiding this comment.
@pranavkm or @NTaylorMullen any ideas on why it doesn't already fail?
I definitely prefer Ordinal comparisons whenever possible, especially for language keyword comparisons.
| return false; | ||
| } | ||
|
|
||
| return left.Equals(right); |
There was a problem hiding this comment.
Note - safe because SourceSpan is a struct, so can't be null, and will never be ReferenceEquals.
|
Looks good so far - let me know when you're done. |
| dotnet_diagnostic.CA1305.severity = error | ||
| dotnet_diagnostic.CA1310.severity = error | ||
| # Temporarily disabling, waiting on PR feedback to re-enable | ||
| dotnet_diagnostic.CA1310.severity = none |
There was a problem hiding this comment.
💡 Setting diagnostic severity is more efficient if it's done in a globalconfig instead of editorconfig. See dotnet/razor#3087 for an example of how I converted aspnetcore-tooling from rulesets to globalconfig.
8c6b64f to
2dd807e
Compare
cb0923c to
05f1003
Compare
5643992 to
2179a45
Compare
|
There are some violations of CA1305 from https://github.com/aspnet/MessagePack-CSharp.git which is imported through gitmodules. I'll move this specific rule to .editorconfig instead of .globalconfig as a workaround. |
|
This should be ready for another look. |
Pilchie
left a comment
There was a problem hiding this comment.
This looks good to me, but I'd like @pranavkm or @NTaylorMullen to make sure they agree with me about the Ordinal comparisons in the Razor compiler before we merge.
pranavkm
left a comment
There was a problem hiding this comment.
Thanks, this is absolutely great!
| var targetQueue = GetTargetHelixQueue().ToLowerInvariant(); | ||
|
|
||
| if (Queues.Contains("All.OSX") && targetQueue.StartsWith("osx")) | ||
| if (Queues.Contains("All.OSX") && targetQueue.StartsWith("osx", StringComparison.OrdinalIgnoreCase)) |
There was a problem hiding this comment.
| if (Queues.Contains("All.OSX") && targetQueue.StartsWith("osx", StringComparison.OrdinalIgnoreCase)) | |
| if (Queues.Contains("All.OSX") && targetQueue.StartsWith("osx", StringComparison.Ordinal)) |
That would be the equivalent to the previous check
There was a problem hiding this comment.
I'll let this be. This is test-only code so it doesn't make a difference.
There was a problem hiding this comment.
@HaoK actually asked to change this to OrdinalIgnoreCase as part of this review.
Fixes #30099
Replaces FxCopAnalyzers package references with NetAnalyzers.(Used from .NET SDK instead of package)@sharwell Can you review?