Skip to content

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Dec 23, 2020

cc: @iSazonov

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0049

Skipped:
src\Microsoft.PowerShell.Commands.Diagnostics\CounterSample.cs
src\Microsoft.PowerShell.Commands.Diagnostics\GetCounterCommand.cs
src\Microsoft.PowerShell.Commands.Diagnostics\PdhHelper.cs

@xtqqczze xtqqczze marked this pull request as ready for review December 23, 2020 22:26
@iSazonov
Copy link
Collaborator

iSazonov commented Dec 24, 2020

I doubt it is necessary. These CIM, WSMan, Counter codes are specific and frozen. All other places have already been corrected earlier. I think we should only set the severity to suggestion.

@ghost ghost added the Review - Needed The PR is being reviewed label Dec 31, 2020
@ghost
Copy link

ghost commented Dec 31, 2020

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@adityapatwardhan
Copy link
Member

@xtqqczze Please resolve merge conflicts

@ghost ghost removed the Review - Needed The PR is being reviewed label Apr 16, 2021
@ghost ghost added the Review - Needed The PR is being reviewed label Apr 24, 2021
@ghost
Copy link

ghost commented Apr 24, 2021

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@anmenaga
Copy link

Maintainer review summary: ok to take this considering that this does not touch files that are frequently changed therefore the chance of introducing merge conflicts is low. Additionally, files that are not part of the build should be removed from this PR (@adityapatwardhan to give list of such files).

@ghost ghost removed the Review - Needed The PR is being reviewed label Apr 27, 2021
@adityapatwardhan
Copy link
Member

The files that are not compiled and hence should be removed from PR. Files to be removed:

PdhHelper.cs
CounterSample.cs
GetCounterCommand.cs

@ghost ghost added the Review - Needed The PR is being reviewed label May 5, 2021
@ghost
Copy link

ghost commented May 5, 2021

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@xtqqczze
Copy link
Contributor Author

xtqqczze commented May 8, 2021

In dotnet/roslyn, the IDE0049 rule is specified as EnforceOnBuild.Never therefore we cannot enforce the rule during build, see:
dotnet/roslyn#50173
https://github.com/dotnet/roslyn/blob/9c10b941e96760e0c986c8f2afb0d5b4c34e67e3/src/Analyzers/Core/Analyzers/EnforceOnBuildValues.cs#L105

There is still value in enabling the rule, as it will be used for live analysis in the IDE.

GitHub
The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs. - dotnet/roslyn

@xtqqczze
Copy link
Contributor Author

@adityapatwardhan The suggested changes have been made, please could you continue your review.

@xtqqczze
Copy link
Contributor Author

rebased

Copy link
Collaborator

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I like the consistency even though it is a lot of code change.

@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Jun 28, 2021
@adityapatwardhan adityapatwardhan merged commit 0f2f23f into PowerShell:master Jul 28, 2021
@ghost ghost removed the Review - Needed The PR is being reviewed label Jul 28, 2021
@adityapatwardhan
Copy link
Member

@xtqqczze Thank you for your contribution!

@xtqqczze
Copy link
Contributor Author

Contributes to #25922.

xtqqczze added a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Sep 25, 2025
Temporarily disable this rule until all violations are addressed.

Not all rule violations were resolved in PowerShell#14491. Since the rulehas internal setting `EnforceOnBuild.Never` it doesn’t affect builds, however it still produces distracting warnings during design-time analysis.

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0049
xtqqczze added a commit to xtqqczze/PowerShell-PowerShell that referenced this pull request Oct 9, 2025
Temporarily disable this rule until all violations are addressed.

Not all rule violations were resolved in PowerShell#14491. Since the rulehas internal setting `EnforceOnBuild.Never` it doesn’t affect builds, however it still produces distracting warnings during design-time analysis.

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0049
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants