Skip to content

Commit 8360238

Browse files
pdgendtkartben
authored andcommitted
scripts: west_commands: zspdx: getincludes: Fix linter issues
Fix issues reported by ruff. Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
1 parent 3ccda0e commit 8360238

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

.ruff-excludes.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,11 +1190,6 @@
11901190
"UP015", # https://docs.astral.sh/ruff/rules/redundant-open-modes
11911191
"UP032", # https://docs.astral.sh/ruff/rules/f-string
11921192
]
1193-
"./scripts/west_commands/zspdx/getincludes.py" = [
1194-
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports
1195-
"UP021", # https://docs.astral.sh/ruff/rules/replace-universal-newlines
1196-
"UP022", # https://docs.astral.sh/ruff/rules/replace-stdout-stderr
1197-
]
11981193
"./scripts/west_commands/zspdx/sbom.py" = [
11991194
"F541", # https://docs.astral.sh/ruff/rules/f-string-missing-placeholders
12001195
"I001", # https://docs.astral.sh/ruff/rules/unsorted-imports

scripts/west_commands/zspdx/getincludes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
from subprocess import run, PIPE
5+
from subprocess import run
66

77
from west import log
88

@@ -30,7 +30,7 @@ def getCIncludes(compilerPath, srcFile, tcg):
3030
# prepare command invocation
3131
cmd = [compilerPath, "-E", "-H"] + fragments + includes + defines + [srcFile]
3232

33-
cp = run(cmd, stdout=PIPE, stderr=PIPE, universal_newlines=True)
33+
cp = run(cmd, capture_output=True, text=True)
3434
if cp.returncode != 0:
3535
log.dbg(f" - calling {compilerPath} failed with error code {cp.returncode}")
3636
return []

0 commit comments

Comments
 (0)