From a9c46eeb9c58f2bfad37d09ca7c4768ff435d747 Mon Sep 17 00:00:00 2001 From: Amin Sadeghi Date: Thu, 4 Apr 2024 14:53:05 -0400 Subject: [PATCH] Exclude non-Python files --- action/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/action/main.py b/action/main.py index 14a3e5f..f7b23fb 100644 --- a/action/main.py +++ b/action/main.py @@ -24,8 +24,9 @@ req = f"ruff{version_specifier}" # If CHANGED_FILES is not empty, split it into a list; otherwise, use SRC files_to_check = shlex.split(CHANGED_FILES or SRC) +# Exclude non-Python files +files_to_check = [f for f in files_to_check if f.endswith(".py")] proc = run(["pipx", "run", req, *shlex.split(ARGS), *files_to_check]) -# proc = run(["pipx", "run", req, *shlex.split(ARGS), *shlex.split(SRC)]) sys.exit(proc.returncode)