[New Analyzer/Fixer] Prefer static HashData method over ComputeHash#4797
[New Analyzer/Fixer] Prefer static HashData method over ComputeHash#4797buyaa-n merged 46 commits intodotnet:mainfrom
Conversation
b2cc096 to
af5ce67
Compare
|
I'm confused about the target branch. targeting master first for the CI |
8d2bce3 to
b97cc5a
Compare
Codecov Report
@@ Coverage Diff @@
## main #4797 +/- ##
==========================================
+ Coverage 95.52% 95.56% +0.03%
==========================================
Files 1275 1280 +5
Lines 292855 296596 +3741
Branches 17691 18014 +323
==========================================
+ Hits 279757 283432 +3675
- Misses 10663 10716 +53
- Partials 2435 2448 +13 |
|
This should target a release/6.0.1xx branch. But not sure if it should target preview1 or preview2 branch. @mavasani to confirm the correct branch. |
There was a problem hiding this comment.
@mavasani @Evangelink Should the title for the codefix start with "Use" instead (i.e. different from analyzer title)?
There was a problem hiding this comment.
IIRC, @sharwell said somewhere that equivalenceKey shouldn't be localized. So you should probably use nameof here. (I'm not sure though what problems can this cause)
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
...ualBasic/Microsoft.NetCore.Analyzers/Performance/BasicPreferHashDataOverComputeHash.Fixer.vb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Not sure if the NotNullWhen attribute is necessary in VB?
There was a problem hiding this comment.
I'm not sure either. VS generated this
...zers/UnitTests/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHashTests.cs
Outdated
Show resolved
Hide resolved
...ualBasic/Microsoft.NetCore.Analyzers/Performance/BasicPreferHashDataOverComputeHash.Fixer.vb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I'm a little bit confused why there are 3 diagnostics here?
There was a problem hiding this comment.
I'm capturing AdditionalLocations for the fixer. Those show up in the diagnostics
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
I think this description should also give a short explanation of why it is simpler.
There was a problem hiding this comment.
Same comment about expanding the description to explain why.
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
|
Is it alright if I just squashed the commits into 1? It's getting messy imo |
...nalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.Fixer.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Performance/PreferHashDataOverComputeHash.cs
Outdated
Show resolved
Hide resolved
...ualBasic/Microsoft.NetCore.Analyzers/Performance/BasicPreferHashDataOverComputeHash.Fixer.vb
Outdated
Show resolved
Hide resolved
it is case-insensitive
|
Hooray! Thanks for the contribution @wzchua. 👍 |
Resolves dotnet/runtime#40579