-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Rename private methods in MshCommandRuntime.cs #9074
Conversation
@@ -2591,7 +2591,7 @@ internal void _WriteObjectSkipAllowCheck(object sendToPipeline) | |||
/// The Cmdlet should generally just allow PipelineStoppedException | |||
/// to percolate up to the caller of ProcessRecord etc. | |||
/// </exception> | |||
internal void _WriteObjectsSkipAllowCheck(object sendToPipeline) | |||
internal void _EnumerateAndWriteObjectSkipAllowCheck(object sendToPipeline) |
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.
internal void _EnumerateAndWriteObjectSkipAllowCheck(object sendToPipeline) | |
internal void EnumerateAndWriteObjectSkipAllowCheck(object sendToPipeline) |
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.
If I go that route it might be better to just rename half the things in this file, in all honesty... There are a lot of similarly questionable names 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.
Oh, no. It is better to spend time to create something useful.
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'll come back to it when I'm really bored and do a proper style pass over the whole thing. 😉
Not a big-ticket item, but there's a lot of room for tidying up in this one. 😄
PR Summary
Renamed methods to avoid confusion when examining and maintaining core runtime code.
DoWriteObjects()
->DoWriteEnumeratedObject()
DoWriteObject()
(no s) method._WriteObjectsSkipAllowCheck()
->_EnumerateAndWriteObjectSkipAllowCheck()
_WriteObjectSkipAllowCheck()
This pair of methods is not actually referenced outside MshCommandRuntime.cs, and only in one or two places; I consider renaming it to be of no risk whatsoever as it is a private method.
There are no functional modifications, just renaming these before someone digs a little too deep here and breaks it by accident due to the very confusing naming scheme.
PR Context
As I was debugging #5955 I noticed that there are two pairs of commands in MshCommandRuntime.cs that deal with writing objects, one set which permits enumerating collections, the other which does not.
These are named far too similarly, where a mere typo could cause the wrong one to be used if this code is ever updated.
PR Checklist
.h
,.cpp
,.cs
,.ps1
and.psm1
files have the correct copyright headerWIP:
or[ WIP ]
to the beginning of the title (theWIP
bot will keep its status check atPending
while the prefix is present) and remove the prefix when the PR is ready.[feature]
to your commit messages if the change is significant or affects feature tests