fix: Script bug fixes (bare except, timezone, regex, test)
- collector.py, compliance_checker.py, trends.py: bare except -> specific - db_helper.py: datetime.now() -> timezone.utc (8 occurrences) - compliance_checker.py: regex \x08 -> \b word boundary + import json - search_providers.py: minor fixes - test_new_features.py: service reachability check retry Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
"""
|
||||
|
||||
import re
|
||||
import json
|
||||
from typing import Dict, List, Tuple
|
||||
|
||||
SENSITIVE_WORDS = {
|
||||
@@ -125,7 +126,7 @@ def _load_platform_rules():
|
||||
for r in rows:
|
||||
try:
|
||||
cfg = json.loads(r.config_data) if r.config_data else {}
|
||||
except:
|
||||
except Exception:
|
||||
cfg = {}
|
||||
if cfg:
|
||||
result[r.platform] = cfg
|
||||
@@ -511,7 +512,7 @@ class ComplianceChecker:
|
||||
})
|
||||
|
||||
def _check_timeliness(self, text: str):
|
||||
years = re.findall(r'(19\d{2}|20[0-4]\d)', text)
|
||||
years = re.findall(r'\b(19\d{2}|20[0-4]\d)\b', text)
|
||||
outdated = {y for y in years if int(y) < 2025}
|
||||
if outdated:
|
||||
self.issues.append({
|
||||
|
||||
Reference in New Issue
Block a user