fix: Resolve 61 critical linting errors
Fixed priority linting errors to improve code quality: Critical Fixes: - F821 (2 errors): Fixed undefined name 'original_result' in config_enhancer.py - UP035 (2 errors): Removed deprecated typing.Dict and typing.Type imports - F401 (27 errors): Removed unused imports and added noqa for availability checks - E722 (19 errors): Replaced bare 'except:' with 'except Exception:' Code Quality Improvements: - SIM201 (4 errors): Simplified 'not x == y' to 'x != y' - SIM118 (2 errors): Removed unnecessary .keys() in dict iterations - E741 (4 errors): Renamed ambiguous variable 'l' to 'line' - I001 (1 error): Sorted imports in test_bootstrap_skill.py All modified areas tested and passing: - test_scraper_features.py: 42 passed - test_integration.py: 51 passed - test_architecture_scenarios.py: 11 passed - test_real_world_fastmcp.py: 19 passed (1 skipped) Remaining linting errors: 249 (mostly code style suggestions like ARG002, F841, SIM102) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -44,7 +44,6 @@ try:
|
||||
detect_patterns_tool,
|
||||
estimate_pages_tool,
|
||||
extract_config_patterns_tool,
|
||||
run_subprocess_with_streaming,
|
||||
scrape_docs_tool,
|
||||
scrape_github_tool,
|
||||
scrape_pdf_tool,
|
||||
|
||||
@@ -53,11 +53,9 @@ import sys
|
||||
# Import FastMCP
|
||||
MCP_AVAILABLE = False
|
||||
FastMCP = None
|
||||
TextContent = None
|
||||
|
||||
try:
|
||||
from mcp.server import FastMCP
|
||||
from mcp.types import TextContent
|
||||
|
||||
MCP_AVAILABLE = True
|
||||
except ImportError as e:
|
||||
|
||||
@@ -112,7 +112,7 @@ def run_subprocess_with_streaming(cmd, timeout=None):
|
||||
line = process.stderr.readline()
|
||||
if line:
|
||||
stderr_lines.append(line)
|
||||
except:
|
||||
except Exception:
|
||||
# Fallback for Windows (no select)
|
||||
time.sleep(0.1)
|
||||
|
||||
@@ -834,7 +834,7 @@ async def scrape_docs_tool(args: dict) -> list[TextContent]:
|
||||
|
||||
# Estimate: 30s per page + buffer
|
||||
timeout = max(3600, max_pages * 35) # Minimum 1 hour, or 35s per page
|
||||
except:
|
||||
except Exception:
|
||||
timeout = 14400 # Default: 4 hours
|
||||
|
||||
# Add progress message
|
||||
|
||||
@@ -84,7 +84,7 @@ def run_subprocess_with_streaming(cmd: list[str], timeout: int = None) -> tuple[
|
||||
line = process.stderr.readline()
|
||||
if line:
|
||||
stderr_lines.append(line)
|
||||
except:
|
||||
except Exception:
|
||||
# Fallback for Windows (no select)
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ def run_subprocess_with_streaming(cmd: list[str], timeout: int = None) -> tuple:
|
||||
line = process.stderr.readline()
|
||||
if line:
|
||||
stderr_lines.append(line)
|
||||
except:
|
||||
except Exception:
|
||||
# Fallback for Windows (no select)
|
||||
time.sleep(0.1)
|
||||
|
||||
@@ -266,7 +266,7 @@ async def scrape_docs_tool(args: dict) -> list[TextContent]:
|
||||
|
||||
# Estimate: 30s per page + buffer
|
||||
timeout = max(3600, max_pages * 35) # Minimum 1 hour, or 35s per page
|
||||
except:
|
||||
except Exception:
|
||||
timeout = 14400 # Default: 4 hours
|
||||
|
||||
# Add progress message
|
||||
|
||||
@@ -79,7 +79,7 @@ def run_subprocess_with_streaming(cmd, timeout=None):
|
||||
line = process.stderr.readline()
|
||||
if line:
|
||||
stderr_lines.append(line)
|
||||
except:
|
||||
except Exception:
|
||||
# Fallback for Windows (no select)
|
||||
time.sleep(0.1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user