-
Notifications
You must be signed in to change notification settings - Fork 96
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
.add_argument() should also add kwargs to callsites #95
base: main
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
I'm not certain what this is getting us. If you're adding a keyword argument to the definition, there's no need to add it to the callers (in the current implementation) because the value will be the same. If the goal is to be able to use the |
It is the latter case. The specific way I used this during my codemods was to add a value, different than the function's default, to a callsite and avoid needing to provide the positional args in between. Good point about looking for arguments that already exist; I will update this PR to account for that. |
Functionality has been added to avoid adding an argument if it is already present in function definitions, and callsites for both positional and kwarg. |
I squashed the history a little, this should be in a state to review now @jreese |
This is on top or PR 102, I believe. |
.add_argument() should also have the ability to add kwargs to callsites to perform codemods where a callsite's kwarg differs from the function definition's default for that arg.
The doc for this specific modifier has been updated to remove the distinction between positional and keyword args since both types can be added to the function definition and the callsites in this PR.