-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix incorrect references and improve formatting in PSCommand XML comments #15568
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
Conversation
|
@octos4murai Please sign CLA. Without this we can not merge the PR. |
Done. Thanks for the reminder. |
rjmholt
left a comment
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 example changes are much needed, thanks!
The parameter name changes we can't take, and I don't think the terminology changes add clarity here
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.
Actually more than strict cmdlets can be used here. The path to a script will work as well, for example
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.
An overload for this method refers to cmdlet in its XML comments summary. Its parameter is also named cmdlet but as you mentioned elsewhere, this would be a breaking change.
Do you suggest to:
- Keep this the same and change the overload method's XML comments to also use
commandto connote that more than strict cmdlets can be used, or - Allow the apparent inconsistency and make no changes?
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.
Its parameter is also named cmdlet but as you mentioned elsewhere, this would be a breaking change.
Yes, it's an unfortunate inconsistency, but one that we must now live with. The parameter name is part of the API.
Feel free to add any extra documentation around the XML, but the parameter names themselves can't be changed.
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.
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.
Noted. I will exclude this breaking change.
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.
@rjmholt I think there is a bug here where a potential null argument is referred to using string "cmdlet". The actual argument name is not "cmdlet" but rather "command". If you agree, perhaps I can replace this line with:
throw PSTraceSource.NewArgumentNullException(nameof(command));
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.
Please pull new PR with the change.
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.
Please pull new PR with the change.
Just would like some clarification -- should I create a new GitHub issue and then create a new PR linked to that issue?
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.
Issues are need only for discussions to understand what we should do or not do. Here we see simple inconsistency and can accept new PR.
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.
Issues are need only for discussions to understand what we should do or not do. Here we see simple inconsistency and can accept new PR.
Got it. Thank you.
|
🎉 Handy links: |
PR Summary
Changes parameter name fromcommandtocmdletinAddCommand(string command)to match its overloadAddCommand(string cmdlet, bool useLocalScope)Fixes a bug where the value passed into the constructor for an Argument Null Exception object does not match the name of the relevant parameterPR Context
Closes #15537
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).