From 6f38def95a5167948fd1a83f5889279718a31f62 Mon Sep 17 00:00:00 2001 From: Daniel D'Avella Date: Thu, 30 Nov 2023 16:20:25 -0500 Subject: [PATCH] List codemods from all codemodders --- src/pixee/cli.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/pixee/cli.py b/src/pixee/cli.py index 8ac4ce3..9f55a24 100644 --- a/src/pixee/cli.py +++ b/src/pixee/cli.py @@ -68,10 +68,18 @@ def fix(path, dry_run): def codemods(): """List available codemods""" console.print("Available codemods:", style="bold") - result = subprocess.run( - [PYTHON_CODEMODDER, "--list"], stdout=subprocess.PIPE, check=True - ) - console.print(result.stdout.decode("utf-8").splitlines()) + + codemods = [] + for codemodder in [PYTHON_CODEMODDER, JAVA_CODEMODDER]: + result = subprocess.run( + [codemodder, "--list"], + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL, + check=True, + ) + codemods.extend(result.stdout.decode("utf-8").splitlines()) + # TODO: filter out non-pixee codemods? + console.print(sorted(codemods)) if __name__ == "__main__":