Skip to content

Commit b5218d4

Browse files
Add 'nosec' skips for Bandit in dev scripts and tests
1 parent 4dd7871 commit b5218d4

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

scripts/generate_docs.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"""
2-
Copyright (C) 2023 Intel Corporation
2+
Copyright (C) 2023-2024 Intel Corporation
33
44
Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
55
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
"""
77

88
from pathlib import Path
99
from shutil import rmtree
10-
import subprocess
10+
import subprocess # nosec B404
1111
import time
1212

1313

@@ -41,9 +41,8 @@ def _prepare_docs_dir(docs_path: Path) -> None:
4141
def _generate_xml(config_path: Path, docs_path: Path) -> None:
4242
print("Generating XML files with doxygen...", flush=True)
4343
try:
44-
subprocess.run(
45-
["doxygen", Path(config_path, "Doxyfile")], text=True
46-
).check_returncode()
44+
subprocess.run(["doxygen", Path(config_path, "Doxyfile")], text=True
45+
).check_returncode() # nosec B603, B607
4746
print(f"All XML files generated in {docs_path}", flush=True)
4847
except subprocess.CalledProcessError as ex:
4948
print("Generating XML files failed!")
@@ -54,9 +53,8 @@ def _generate_xml(config_path: Path, docs_path: Path) -> None:
5453
def _generate_html(config_path: Path, docs_path: Path) -> None:
5554
print("Generating HTML pages with sphinx...", flush=True)
5655
try:
57-
subprocess.run(
58-
["sphinx-build", config_path, Path(docs_path, "html")], text=True
59-
).check_returncode()
56+
subprocess.run(["sphinx-build", config_path, Path(docs_path, "html")], text=True
57+
).check_returncode() # nosec B603, B607
6058
print(f"All HTML files generated in {docs_path}", flush=True)
6159
except subprocess.CalledProcessError as ex:
6260
print("Generating HTML pages failed!")

test/test_installation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import difflib
1010
from pathlib import Path
1111
import platform
12-
import subprocess
12+
import subprocess # nosec B404
1313
import sys
1414
from typing import List
1515

@@ -143,7 +143,7 @@ def install_umf(self) -> None:
143143

144144
install_cmd = f"cmake --install {self.build_dir} --config {self.build_type.title()} --prefix {self.install_dir}"
145145
try:
146-
subprocess.run(install_cmd.split()).check_returncode()
146+
subprocess.run(install_cmd.split()).check_returncode() # nosec B603
147147
except subprocess.CalledProcessError:
148148
sys.exit(f"Error: UMF installation command '{install_cmd}' failed")
149149

@@ -180,7 +180,7 @@ def uninstall_umf(self) -> None:
180180
"""
181181
uninstall_cmd = f"cmake --build {self.build_dir} --target uninstall"
182182
try:
183-
subprocess.run(uninstall_cmd.split()).check_returncode()
183+
subprocess.run(uninstall_cmd.split()).check_returncode() # nosec B603
184184
except subprocess.CalledProcessError:
185185
sys.exit(f"Error: UMF uninstallation command '{uninstall_cmd}' failed")
186186

0 commit comments

Comments
 (0)