Skip to content

fix: resolve linting and typecheck errors#771

Open
claude[bot] wants to merge 1 commit intomainfrom
assistant/improve-20260315-072705
Open

fix: resolve linting and typecheck errors#771
claude[bot] wants to merge 1 commit intomainfrom
assistant/improve-20260315-072705

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Mar 15, 2026

Summary

This PR fixes 41 linting issues and 1 typecheck error found by ruff and basedpyright.

Changes

Linting Fixes (41 issues)

  • Import sorting: Reorganized imports in multiple files to comply with ruff's I001 rule
  • Trailing whitespace: Removed trailing whitespace in huggingface_provider.py (W291, W293 violations)
  • Style improvements:
    • Replaced [sys.executable, SCRIPT] + list(sections) with [sys.executable, SCRIPT, *list(sections)] (RUF005)
    • Replaced list(blobs.values())[0] with next(iter(blobs.values())) (RUF015)
    • Removed unnecessary mode argument from open() calls (UP015)

Typecheck Fix

  • src/nodetool/worker/provider_handler.py: Fixed type annotation mismatch
    • Changed MessageImageContent(type="image", ...) to MessageImageContent(type="image_url", ...)
    • The MessageImageContent.type field is defined as Literal["image_url"], not Literal["image"]

Verification

All validation steps pass:

  • make lint - All 41 linting issues resolved
  • make typecheck - No type errors
  • make test - 4112 tests passed

Note: 8 test failures in SERP provider tests are pre-existing issues unrelated to these changes (ApifyProvider and DataForSEOProvider missing abstract method implementation).

Files Changed

  • src/nodetool/providers/huggingface_provider.py - Trailing whitespace cleanup
  • src/nodetool/worker/provider_handler.py - Import sorting + type fix
  • src/nodetool/worker/__main__.py - Import sorting
  • src/nodetool/worker/context_stub.py - Import sorting
  • src/nodetool/worker/server.py - Import sorting
  • src/nodetool/workflows/asset_storage.py - Import sorting
  • Multiple test files - Import sorting and style improvements

🤖 Generated with Claude Code

- Applied ruff auto-fixes for 41 linting issues (import sorting, trailing whitespace, style violations)
- Fixed type annotation mismatch in provider_handler.py: changed MessageImageContent(type="image") to type="image_url" to match Literal type definition
- Removed unnecessary mode argument from patch scripts (UP015)
- Reorganized imports in multiple files for consistency (I001)
- Cleaned up trailing whitespace in huggingface_provider.py (W291, W293)

All lint checks now pass. Typecheck passes with no errors.
Tests: 4112 passed (8 pre-existing failures in SERP provider tests unrelated to these changes)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants