Skip to content

Python: Remove getAnArg from DataFlow::CallCfgNode#5253

Merged
codeql-ci merged 2 commits into
github:mainfrom
RasmusWL:no-getAnArg
Feb 24, 2021
Merged

Python: Remove getAnArg from DataFlow::CallCfgNode#5253
codeql-ci merged 2 commits into
github:mainfrom
RasmusWL:no-getAnArg

Conversation

@RasmusWL
Copy link
Copy Markdown
Member

@RasmusWL RasmusWL commented Feb 24, 2021

As discussed internally before, the getAnArg name clashes with the functionality in Function: github/codeql-python-team#95 (and our normal pattern of when providing getFoo(index i), then also providing getAFoo() { result = this.getFoo(_) })

Follow up to #5251

I've seen quite a few places where `getAnArg` leads to wrong behavior, and I
generally just don't like it.
@RasmusWL RasmusWL requested a review from a team as a code owner February 24, 2021 09:28
@RasmusWL RasmusWL added the no-change-note-required This PR does not need a change note label Feb 24, 2021
Until we've had further discussion on what is the right approach to
naming (internal discussion in github/codeql-python-team#95)
/** Gets the data-flow node corresponding to an argument of the call corresponding to this data-flow node */
Node getAnArg() {
/** Gets the data-flow node corresponding to any argument (positional or keyword) of the call corresponding to this data-flow node */
Node getAnyArg() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should just remove this method until we've reached consensus about its name. Leaving it in means people might start using it, which makes any future renaming awkward.

@RasmusWL RasmusWL requested a review from tausbn February 24, 2021 14:02
@RasmusWL
Copy link
Copy Markdown
Member Author

RasmusWL commented Feb 24, 2021

Yep, that's what we agreed, and that's what I just did 👍 (see new force pushed commit)

@RasmusWL RasmusWL changed the title Python: Rename getAnArg to getAnyArg in DataFlow::CallCfgNode Python: Remove getAnArg from DataFlow::CallCfgNode Feb 24, 2021
@codeql-ci codeql-ci merged commit bf66bdb into github:main Feb 24, 2021
@RasmusWL RasmusWL deleted the no-getAnArg branch February 24, 2021 14:34
@tausbn tausbn mentioned this pull request Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants