Skip to content
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

Requesting a non-existent codemod should be a warning and not a hard error #346

Closed
drdavella opened this issue Mar 8, 2024 · 6 comments · Fixed by #384
Closed

Requesting a non-existent codemod should be a warning and not a hard error #346

drdavella opened this issue Mar 8, 2024 · 6 comments · Fixed by #384
Assignees

Comments

@drdavella
Copy link
Member

pixee/codemodder-specs#18

@clavedeluna
Copy link
Contributor

A warning but continue running with all codemods? Or what should replace CLI error: argument --codemod-include: invalid choice(s): ...?

@drdavella
Copy link
Member Author

So I think if --codemod-include is given a non-existent codemod, we should get a warning like "Requested codemod foo:bar/baz does not exist" and it should just be ignored. And we should get a similar warning for --codemod-exclude.

@clavedeluna clavedeluna self-assigned this Mar 12, 2024
@clavedeluna
Copy link
Contributor

@drdavella refining logic question: what is your expected logic if you run codemodder tests/samples/ --output here.txt --codemod-include=bad1,bad2, where none of the codemods requested exist. Should it run all default codemods or not run anything? I think it should not run anything, because the same example but with codemod-exclude is more clear:

if codemodder tests/samples/ --output here.txt --codemod-exclude=bad1,bad2 runs, where the requested excluded codemods don't match anything, we should run all default codemods since nothing was excluded.

@drdavella
Copy link
Member Author

@clavedeluna I think you're right; it should exit cleanly without doing anything (but critically it should still generate CodeTF if requested).

@drdavella
Copy link
Member Author

Just to clarify: I think this should be implemented without any explicit shortcut logic since I think the rest will just fall out as a consequence of having no codemods to run. If that makes any sense.

@clavedeluna
Copy link
Contributor

@drd See #377 which is related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants