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:
yusyus
2026-01-17 22:54:40 +03:00
parent 5d1a84d100
commit ec3e0bf491
36 changed files with 56 additions and 66 deletions

View File

@@ -29,15 +29,16 @@ except ImportError:
logger.debug("PyYAML not available - YAML parsing will be limited")
try:
import tomli
import tomli as toml_lib
TOML_AVAILABLE = True
except ImportError:
try:
import toml
import toml as toml_lib # noqa: F401
TOML_AVAILABLE = True
except ImportError:
toml_lib = None
TOML_AVAILABLE = False
logger.debug("toml/tomli not available - TOML parsing disabled")
@@ -408,13 +409,7 @@ class ConfigParser:
return
try:
if "tomli" in globals():
data = tomli.loads(config_file.raw_content)
else:
import toml
data = toml.loads(config_file.raw_content)
data = toml_lib.loads(config_file.raw_content)
self._extract_settings_from_dict(data, config_file)
except Exception as e:
config_file.parse_errors.append(f"TOML parse error: {str(e)}")