Skip to content

Commit 0166ece

Browse files
committed
Handle bandit assessement
1 parent 67b07ef commit 0166ece

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

PyFunceble/cli/migrators/mariadb/file_and_status.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def migrate(self) -> "FileAndStatusMigrator":
107107
destination = get_destination_from_origin(file_info["path"])
108108

109109
for status in self.get_rows(
110-
f"SELECT * from pyfunceble_status WHERE file_id = {file_info['id']}"
110+
f"SELECT * from pyfunceble_status WHERE file_id = {file_info['id']}" # nosec: B608 # Self-Controlled Input
111111
):
112112
if (
113113
self.continuous_integration
@@ -144,7 +144,9 @@ def migrate(self) -> "FileAndStatusMigrator":
144144

145145
# pylint: disable=line-too-long
146146
self.db_session.execute(
147-
text(f"DELETE from pyfunceble_status WHERE id = {status['id']}")
147+
text(
148+
f"DELETE from pyfunceble_status WHERE id = {status['id']}" # nosec: B608 # Self-Controlled Input
149+
)
148150
)
149151
self.db_session.commit()
150152

@@ -155,7 +157,9 @@ def migrate(self) -> "FileAndStatusMigrator":
155157
if drop_table:
156158
# pylint: disable=line-too-long
157159
self.db_session.execute(
158-
text(f"DELETE from pyfunceble_file WHERE id = {file_info['id']}")
160+
text(
161+
f"DELETE from pyfunceble_file WHERE id = {file_info['id']}" # nosec: B608 # Self-Controlled Input
162+
)
159163
)
160164
self.db_session.commit()
161165

PyFunceble/helpers/command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def execute(self, *, raise_on_error: bool = False) -> str:
191191
self.command,
192192
stdout=subprocess.PIPE,
193193
stderr=subprocess.STDOUT,
194-
shell=True,
194+
shell=True, # nosec: B602 # Aware of the security implications.
195195
env=os.environ,
196196
) as process:
197197
stdout, stderr = process.communicate()
@@ -222,7 +222,7 @@ def run(self, rstrip: bool = True) -> Generator[str, None, None]:
222222
self.command,
223223
stdout=subprocess.PIPE,
224224
stderr=subprocess.STDOUT,
225-
shell=True,
225+
shell=True, # nosec: B602 # Aware of the security implications.
226226
env=os.environ,
227227
) as process:
228228
while True:

0 commit comments

Comments
 (0)