Skip to content

Commit fed2244

Browse files
committed
fix: Resolve E501 line length violations in security comments
- Shortened security comment messages to fit 88-character line limit - Moved nosec codes to end of line for better formatting - Applied Black formatting to ensure consistent code style - All flake8 and Black checks now pass cleanly Final fix for CI test 3.11 linting pipeline compliance
1 parent 9bfd92b commit fed2244

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

src/orchestrator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ def create_job_manifest(self, job: BatchJob) -> Dict:
272272
"capabilities": {"drop": ["ALL"]},
273273
},
274274
"volumeMounts": [
275-
# nosec B108: Kubernetes requires explicit tmp directory for pod security
276-
{"name": "tmp", "mountPath": "/tmp"}, # nosec
275+
# K8s pod security requires explicit tmp mount
276+
{"name": "tmp", "mountPath": "/tmp"}, # nosec B108
277277
{"name": "cache", "mountPath": "/app/.cache"},
278278
],
279279
}

src/parsers/generic_news.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ async def _extract_basic_content(self, page: Page) -> Dict[str, Any]:
133133
break
134134
except (
135135
Exception
136-
): # nosec B112: Intentional broad exception handling for web scraping robustness
136+
): # nosec B112: Broad exception for web scraping robustness
137137
continue
138138

139139
# Try common content selectors
@@ -157,7 +157,7 @@ async def _extract_basic_content(self, page: Page) -> Dict[str, Any]:
157157
break
158158
except (
159159
Exception
160-
): # nosec B112: Intentional broad exception handling for web scraping robustness
160+
): # nosec B112: Broad exception for web scraping robustness
161161
continue
162162

163163
# Try to get page title if no article title found

src/parsers/weibo.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ async def _safe_text_content(self, page: Page, selectors: str) -> Optional[str]:
9494
text = await element.text_content()
9595
if text and text.strip():
9696
return text.strip()
97-
except (
98-
Exception
99-
): # nosec B112: Intentional broad exception handling for web scraping robustness
97+
except Exception: # nosec B112: Broad exception for web scraping robustness
10098
continue
10199
return None
102100

0 commit comments

Comments
 (0)