disnake icon indicating copy to clipboard operation
disnake copied to clipboard

custom codemod cli

Open onerandomusername opened this issue 2 years ago • 0 comments

Is it possible to completely skip parsing of files that don't contain this string? It's not really worth it to parse the module into a CST (certainly the most expensive part of the process), only to skip it based on the original raw text contents.

If not possible with libcst.tool, we might be able to write our own entrypoint that filters files before passing them into libcst, shouldn't be too complex since they provide a couple useful tools: https://libcst.readthedocs.io/en/latest/codemods.html#command-line-toolkit

Alternatively, we could use the nox session to filter them before calling libcst; it would require always using nox instead of calling libcst directly, but that should be fine.

Originally posted by @shiftinv in https://github.com/DisnakeDev/disnake/pull/708#discussion_r947330751

onerandomusername avatar Aug 18 '22 21:08 onerandomusername