Skip to content

Commit c2ff6a8

Browse files
committed
fix: Add noqa comments for both ruff and bandit
Add both # noqa: S311 (ruff) and # nosec B311 (bandit) to suppress security warnings for non-cryptographic random usage
1 parent 59ee788 commit c2ff6a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dreadnode/transforms/constitutional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def transform(text: str) -> str:
391391

392392
# Randomly intersperse noise functions
393393
for noise in noise_funcs[:num_noise_functions]:
394-
insert_pos = random.randint(0, len(functions)) # nosec B311
394+
insert_pos = random.randint(0, len(functions)) # noqa: S311 # nosec B311
395395
functions.insert(insert_pos, noise)
396396

397397
# Build code
@@ -881,7 +881,7 @@ async def transform(text: str) -> str:
881881
templates = _CHEMISTRY_RIDDLE_TEMPLATES.get(
882882
complexity, _CHEMISTRY_RIDDLE_TEMPLATES["moderate"]
883883
)
884-
template = random.choice(templates) # nosec B311
884+
template = random.choice(templates) # noqa: S311 # nosec B311
885885

886886
# Simple pattern matching
887887
if "hydrogen" in text.lower() and "chlor" in text.lower():

0 commit comments

Comments
 (0)