style: Fix 411 ruff lint issues (Kimi's issue #4)

Auto-fixed lint issues with ruff --fix and --unsafe-fixes:

Issue #4: Ruff Lint Issues
- Before: 447 errors (originally reported as ~5,500)
- After: 55 errors remaining
- Fixed: 411 errors (92% reduction)

Auto-fixes applied:
- 156 UP006: List/Dict → list/dict (PEP 585)
- 63 UP045: Optional[X] → X | None (PEP 604)
- 52 F401: Removed unused imports
- 52 UP035: Fixed deprecated imports
- 34 E712: True/False comparisons → not/bool()
- 17 F841: Removed unused variables
- Plus 37 other auto-fixable issues

Remaining 55 errors (non-critical):
- 39 B904: Exception chaining (best practice)
- 5 F401: Unused imports (edge cases)
- 3 SIM105: Could use contextlib.suppress
- 8 other minor style issues

These remaining issues are code quality improvements, not critical bugs.

Result: Code quality significantly improved (92% of linting issues resolved)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
yusyus
2026-02-08 12:46:38 +03:00
parent 0573ef24f9
commit 51787e57bc
56 changed files with 277 additions and 360 deletions

View File

@@ -17,12 +17,12 @@ Usage:
import json
import time
from pathlib import Path
import pytest
from skill_seekers.cli.adaptors import get_adaptor
from skill_seekers.cli.adaptors.base import SkillMetadata
import contextlib
@pytest.fixture
@@ -144,7 +144,7 @@ class TestWeaviateIntegration:
# Package skill
adaptor = get_adaptor("weaviate")
metadata = SkillMetadata(
SkillMetadata(
name="integration_test",
description="Integration test skill for Weaviate"
)
@@ -231,7 +231,7 @@ class TestWeaviateIntegration:
# Package with rich metadata
adaptor = get_adaptor("weaviate")
metadata = SkillMetadata(
SkillMetadata(
name="metadata_test",
description="Test metadata preservation",
version="2.0.0",
@@ -271,10 +271,8 @@ class TestWeaviateIntegration:
assert "test" in obj["tags"], "Tags not preserved"
finally:
try:
with contextlib.suppress(Exception):
client.schema.delete_class(class_name)
except Exception:
pass
@pytest.mark.integration
@@ -302,7 +300,7 @@ class TestChromaIntegration:
# Package skill
adaptor = get_adaptor("chroma")
metadata = SkillMetadata(
SkillMetadata(
name="chroma_integration_test",
description="Integration test skill for ChromaDB"
)
@@ -415,10 +413,8 @@ class TestChromaIntegration:
"Filter returned wrong category"
finally:
try:
with contextlib.suppress(Exception):
client.delete_collection(name=collection_name)
except Exception:
pass
@pytest.mark.integration
@@ -447,7 +443,7 @@ class TestQdrantIntegration:
# Package skill
adaptor = get_adaptor("qdrant")
metadata = SkillMetadata(
SkillMetadata(
name="qdrant_integration_test",
description="Integration test skill for Qdrant"
)
@@ -554,7 +550,7 @@ class TestQdrantIntegration:
# Package and upload
adaptor = get_adaptor("qdrant")
metadata = SkillMetadata(
SkillMetadata(
name="qdrant_filter_test",
description="Test filtering capabilities"
)
@@ -610,10 +606,8 @@ class TestQdrantIntegration:
"Filter returned wrong type"
finally:
try:
with contextlib.suppress(Exception):
client.delete_collection(collection_name)
except Exception:
pass
if __name__ == "__main__":