-
Notifications
You must be signed in to change notification settings - Fork 468
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
Add analyzers/fixers for Environment.ProcessPath and CurrentManagedThreadId #4909
Add analyzers/fixers for Environment.ProcessPath and CurrentManagedThreadId #4909
Conversation
Codecov Report
@@ Coverage Diff @@
## release/6.0.1xx-preview3 #4909 +/- ##
============================================================
- Coverage 95.57% 95.56% -0.01%
============================================================
Files 1175 1175
Lines 269054 269300 +246
Branches 16302 16314 +12
============================================================
+ Hits 257144 257363 +219
- Misses 9784 9805 +21
- Partials 2126 2132 +6 |
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembersFixer.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentProcessIdTests.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Show resolved
Hide resolved
src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentProcessIdTests.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
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.
I think this should target .NET 6 branch (6.0.1xx-preview3
).
@stephentoub as @Youssef1313 says, master is currently being used to service nuget packages. This PR should target https://github.com/dotnet/roslyn-analyzers/tree/release/6.0.1xx-preview3 |
591a23e
to
9e8219e
Compare
Feedback addressed and rebased on release/6.0.1xx-preview3 |
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/UnitTests/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembersTests.cs
Show resolved
Hide resolved
Test failure is unrelated and was fixed in dotnet/roslyn#51244 |
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime/UseEnvironmentMembers.cs
Outdated
Show resolved
Hide resolved
23656d8
to
d45a6f6
Compare
@" | ||
using System; | ||
using System.Diagnostics; | ||
using System.Threading; |
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.
The codefix could cleanup the now-unused usings. This is not necessary but probably good to have as a follow-up. Should I open an issue tracking this?
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.
Do we do that with other analyzers? Removing usings seems orthogonal and a style preference, not something we should be doing automatically just because we happened to remove the last use of something in that namespace. We could actually be creating more work and confusion for the developer.
@mavasani, any feedback before it's merged? Thanks. |
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.
Looks great to me!
Fixes dotnet/runtime#43257
Fixes dotnet/runtime#42948
cc: @carlossanlop, @mavasani, @jkotas