Skip to content

Commit 8dee24e

Browse files
authored
Lint fix (#466)
* random.uniform() is safe here as jitter is only used for retry timing Signed-off-by: Mihai Criveti <[email protected]> * Update Makefile formatting * Added pytest-trio --------- Signed-off-by: Mihai Criveti <[email protected]>
1 parent ac75499 commit 8dee24e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,10 @@ vulture: ## 🧹 Dead code detection
610610
# -----------------------------------------------------------------------------
611611
# 📑 GRYPE SECURITY/VULNERABILITY SCANNING
612612
# -----------------------------------------------------------------------------
613-
# help: grype-install - Install Grype
614-
# help: grype-scan - Scan all files using grype
615-
# help: grype-sarif - Generate SARIF report
616-
# help: security-scan - Run Trivy security-scan
613+
# help: grype-install - Install Grype
614+
# help: grype-scan - Scan all files using grype
615+
# help: grype-sarif - Generate SARIF report
616+
# help: security-scan - Run Trivy security-scan
617617
.PHONY: grype-install grype-scan grype-sarif security-scan
618618

619619
grype-install:
@@ -890,7 +890,7 @@ sonar-info:
890890
# 🛡️ SECURITY & PACKAGE SCANNING
891891
# =============================================================================
892892
# help: 🛡️ SECURITY & PACKAGE SCANNING
893-
# help: trivy-install - Install Trivy
893+
# help: trivy-install - Install Trivy
894894
# help: trivy - Scan container image for CVEs (HIGH/CRIT). Needs podman socket enabled
895895
.PHONY: trivy-install trivy
896896

mcpgateway/utils/retry_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ async def _sleep_with_jitter(self, base: float, jitter_range: float):
9393
base (float): The base sleep time.
9494
jitter_range (float): The range within which the jitter will be applied.
9595
"""
96-
delay = base + random.uniform(0, jitter_range)
96+
# random.uniform() is safe here as jitter is only used for retry timing, not security
97+
delay = base + random.uniform(0, jitter_range) # noqa: DUO102 # nosec B311
9798
# Ensure delay doesn't exceed the max allowed
9899
delay = min(delay, self.max_delay)
99100
await asyncio.sleep(delay)

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ dev = [
139139
"pytest-examples>=0.0.18",
140140
"pytest-md-report>=0.7.0",
141141
"pytest-rerunfailures>=15.1",
142+
"pytest-trio>=0.8.0",
142143
"pytest-xdist>=3.8.0",
143144
"pytype>=2024.10.11",
144145
"pyupgrade>=3.20.0",

0 commit comments

Comments
 (0)