Skip to content
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 analyzer for Environment.ProcessPath #42948

Closed
jkotas opened this issue Oct 1, 2020 · 4 comments · Fixed by dotnet/roslyn-analyzers#4909 or #49393
Closed

Add analyzer for Environment.ProcessPath #42948

jkotas opened this issue Oct 1, 2020 · 4 comments · Fixed by dotnet/roslyn-analyzers#4909 or #49393
Assignees
Labels
api-approved API was approved in API review, it can be implemented area-System.Runtime code-analyzer Marks an issue that suggests a Roslyn analyzer code-fixer Marks an issue that suggests a Roslyn code fixer help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@jkotas
Copy link
Member

jkotas commented Oct 1, 2020

Environment.ProcessPath API introduced by #40862 is a significantly more efficient replacement of Process.GetCurrentProcess().MainModule.FileName. This pattern is quite common. We should add analyzer and fixer for this.

More context: #42768 (comment)

@jkotas jkotas added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Oct 1, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Oct 1, 2020
@jkotas jkotas added code-analyzer Marks an issue that suggests a Roslyn analyzer area-System.Runtime help wanted [up-for-grabs] Good issue for external contributors and removed untriaged New issue has not been triaged by the area owner labels Oct 1, 2020
@Serg046
Copy link
Contributor

Serg046 commented Oct 3, 2020

I'll do it, guess it should be there https://github.com/dotnet/roslyn-analyzers/tree/master/src/NetAnalyzers/Core/Microsoft.NetCore.Analyzers/Runtime.
While I'm preparing a PR, you can suggest an analyzer key, name, etc (otherwise we will discuss it in scope of the PR)

@jkotas
Copy link
Member Author

jkotas commented Oct 5, 2020

Thank you @Serg046 !

The naming and structure of this analyzer should mirror the naming and structure of the existing UseEnvironmentProcessId analyzer. It may be idea a good idea to just add handling of this pattern to the existing analyzer - see #42768 (comment) and #42768 (comment) for more context.

@stephentoub stephentoub added api-ready-for-review API is ready for review, it is NOT ready for implementation code-fixer Marks an issue that suggests a Roslyn code fixer and removed api-suggestion Early API idea and discussion, it is NOT ready for implementation labels Oct 12, 2020
@terrajobst terrajobst added api-approved API was approved in API review, it can be implemented and removed api-ready-for-review API is ready for review, it is NOT ready for implementation labels Oct 20, 2020
@terrajobst
Copy link
Member

terrajobst commented Oct 20, 2020

Video

Makes sense as proposed

@ghost ghost locked as resolved and limited conversation to collaborators Apr 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api-approved API was approved in API review, it can be implemented area-System.Runtime code-analyzer Marks an issue that suggests a Roslyn analyzer code-fixer Marks an issue that suggests a Roslyn code fixer help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
6 participants