mirror of
https://github.com/astral-sh/ruff-action.git
synced 2026-05-21 16:30:14 +02:00
Exclude non-Python files
This commit is contained in:
+2
-1
@@ -24,8 +24,9 @@ req = f"ruff{version_specifier}"
|
|||||||
|
|
||||||
# If CHANGED_FILES is not empty, split it into a list; otherwise, use SRC
|
# If CHANGED_FILES is not empty, split it into a list; otherwise, use SRC
|
||||||
files_to_check = shlex.split(CHANGED_FILES or 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), *files_to_check])
|
||||||
# proc = run(["pipx", "run", req, *shlex.split(ARGS), *shlex.split(SRC)])
|
|
||||||
|
|
||||||
sys.exit(proc.returncode)
|
sys.exit(proc.returncode)
|
||||||
|
|||||||
Reference in New Issue
Block a user