scripts: ci: check_compliance: ruff: avoid mixing stdout and stderr

The python subprocess call had a stdout=subprocess.PIPE parameter that
redirects standard output to a pipe, and a stderr=subprocess.STDOUT
parameter that redirected stderr to the pipe. This mixed JSON and
non-JSON output together, and issued an exception. Fixing with
stderr=subprocess.DEVNULL to ignore standard error and only keep the
JSON output.

Signed-off-by: Josuah Demangeon <me@josuah.net>
This commit is contained in:
Josuah Demangeon 2024-11-22 22:02:19 +00:00 committed by Benjamin Cabé
commit d6b8912ad9

View file

@ -1657,7 +1657,7 @@ class Ruff(ComplianceTest):
f"ruff check --force-exclude --output-format=json {file}",
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
stderr=subprocess.DEVNULL,
shell=True,
cwd=GIT_TOP,
)