-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
[Call-by-name] semgrep/trufflehog/yamllint migration #21149
[Call-by-name] semgrep/trufflehog/yamllint migration #21149
Conversation
@@ -556,20 +567,89 @@ def map_dict_form_get_to_new_syntax( | |||
# ------------------------------------------------------------------------------------------ | |||
|
|||
|
|||
def remove_unused_implicitly(call: cst.Call, called_func: cst.FunctionDef) -> cst.Call: | |||
def fix_implicitly_usage(call: cst.Call, target_func: cst.FunctionDef) -> cst.Call: |
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.
Reviewers can largely ignore this function - it's getting updated, modified, and re-factored basically every new migration to handle missing implicitly
cases - and once those cases are stable and tested, I will re-factor this and also extract it to a separate fixer.
Only committing here in the event anyone else wants to run migration, this version better handles implicitly cleanup.
The tests in migrate_call_by_name_tests.py
are likely more interesting.
Of note: This was the first PR that I didn't manually do any implicitly clean up upon, so I feel like the implicitly fixer is slowly converging. But the fixer explicitly does not handle certain cases (e.g. more complicated dictionaries) because they're currently rare, those cases can be fixed by hand very quickly, and I'm trying to focus more time on getting the codebase migrated vs perfecting all the fixer use cases. The latter is more important when the migration goal is opened up to in-repo plugins, where we want to be as seamless as possible |
This is a PR for the call-by-name migration on multiple, smaller, experimental backends. SemGrep, TruffleHog, YamlLint
Tested on https://github.com/sureshjoshi/pantsanity (as much as reasonably possible) via
pants sanity ::
See issue #21065 for tracking list.