Skip to content

Fix IDE0049 for object in System.Management.Automation. Part 1#25923

Merged
iSazonov merged 2 commits into
PowerShell:masterfrom
xtqqczze:IDE0049-sma-object
Oct 17, 2025
Merged

Fix IDE0049 for object in System.Management.Automation. Part 1#25923
iSazonov merged 2 commits into
PowerShell:masterfrom
xtqqczze:IDE0049-sma-object

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

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

Contributes to: #25922.

This change was isolated from #25900 using a filtering script.

@xtqqczze xtqqczze marked this pull request as ready for review August 26, 2025 23:51
@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Aug 27, 2025
@iSazonov
Copy link
Copy Markdown
Collaborator

iSazonov commented Sep 3, 2025

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@xtqqczze
Copy link
Copy Markdown
Contributor Author

@iSazonov can we merge?

@iSazonov
Copy link
Copy Markdown
Collaborator

/azp run PowerShell-Windows-Packaging-CI, PowerShell-CI-linux-packaging

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@microsoft-github-policy-service microsoft-github-policy-service Bot removed the Review - Needed The PR is being reviewed label Oct 16, 2025
/// be an enumerable, you can derive from <see cref="ValidateEnumeratedArgumentsAttribute"/>
/// which will take care of unrolling the enumerable and validate each element individually.
/// It is also recommended to override <see cref="System.Object.ToString"/> to return a readable string
/// It is also recommended to override <see cref="object.ToString"/> to return a readable string
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The System.Object full name looks better and matches what is in the documentation. I think it's right. Can we change only the code but not the XML comments?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We would need #pragma warning disable IDE0049 // Simplify Names which would surely look worse. The documentation appears to be built automatically from these comments.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Generated docs look good.

@iSazonov iSazonov changed the title Fix IDE0049 for object in System.Management.Automation Fix IDE0049 for object in System.Management.Automation. Part 1 Oct 17, 2025
@iSazonov iSazonov merged commit 907c3b1 into PowerShell:master Oct 17, 2025
36 checks passed
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

microsoft-github-policy-service Bot commented Oct 17, 2025

📣 Hey @@xtqqczze, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

@xtqqczze xtqqczze deleted the IDE0049-sma-object branch October 17, 2025 10:41
SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request Dec 12, 2025
kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request Jan 2, 2026
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.

2 participants