From d6b8912ad9a217cd716740a054541a9502ac269f Mon Sep 17 00:00:00 2001 From: Josuah Demangeon Date: Fri, 22 Nov 2024 22:02:19 +0000 Subject: [PATCH] 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 --- scripts/ci/check_compliance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ci/check_compliance.py b/scripts/ci/check_compliance.py index 40b90e2aa39..8c34c1d6899 100755 --- a/scripts/ci/check_compliance.py +++ b/scripts/ci/check_compliance.py @@ -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, )