fix(lint): fix RUF001 unicode and RUF100 unused noqa after format
- Replace ambiguous ➖ unicode with '-' in daily_intel.py and drop noqa
- Move S603 noqa to the actual subprocess.run line in ghostunnel_manager.py
and rmi_dashboard.py
This commit is contained in:
parent
e784deed78
commit
1da2a92f33
3 changed files with 6 additions and 6 deletions
|
|
@ -161,8 +161,8 @@ def _build_research_context(data: dict) -> str:
|
|||
articles = news.get("articles", [])
|
||||
if articles:
|
||||
headlines = "\n".join(
|
||||
f"- [{a.get('sentiment', {}).get('sentiment', '➖')}] {a.get('title', '')}"
|
||||
for a in articles[:15] # noqa: RUF001
|
||||
f"- [{a.get('sentiment', {}).get('sentiment', '-')}] {a.get('title', '')}"
|
||||
for a in articles[:15]
|
||||
)
|
||||
parts.append(f"## TOP HEADLINES\n{headlines}")
|
||||
|
||||
|
|
|
|||
|
|
@ -45,9 +45,9 @@ class GhostunnelManager:
|
|||
def _check_available(self) -> bool:
|
||||
"""Check if ghostunnel is installed."""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
result = subprocess.run( # noqa: S603 - ghostunnel_bin resolved via shutil.which or constructor default
|
||||
[self.ghostunnel_bin, "version"], capture_output=True, timeout=5
|
||||
) # noqa: S603 - ghostunnel_bin resolved via shutil.which or constructor default
|
||||
)
|
||||
return result.returncode == 0
|
||||
except (subprocess.TimeoutExpired, FileNotFoundError):
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -198,9 +198,9 @@ class Dashboard:
|
|||
"""Get backend process ID."""
|
||||
try:
|
||||
pgrep_bin = shutil.which("pgrep") or "pgrep"
|
||||
result = subprocess.run(
|
||||
result = subprocess.run( # noqa: S603 - pgrep with fixed pattern, argv list
|
||||
[pgrep_bin, "-f", "uvicorn main:app"], capture_output=True, text=True, timeout=5
|
||||
) # noqa: S603 - pgrep with fixed pattern, argv list
|
||||
)
|
||||
if result.stdout.strip():
|
||||
return int(result.stdout.strip())
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue