[PR #25185] [Chore/Refactor] Improve type checking configuration #30961

Closed
opened 2026-02-21 20:48:33 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/25185

State: closed
Merged: Yes


Summary

This PR improves the type checking configuration by resetting Pyright to strict mode and adding mypy to the CI pipeline.

Changes

  • Reset pyrightconfig.json to strict mode with temporary file exclusions instead of rule suppressions
  • Add mypy type checker to CI workflow for additional coverage
  • Fix type issues in affected files:
    • app_factory.py: Capture decorator return value to avoid unused function warning
    • chunk_merger.py: Add proper type casting for merged messages
    • tool_manager.py: Fix lambda function attribute access
    • dataset_service.py: Add proper return statement for error case
    • builtin_tools_manage_service.py: Fix lambda function attribute access

Motivation

The previous Pyright configuration ignored too many rules, reducing type checking effectiveness. This change establishes a stricter baseline that we can incrementally improve by fixing excluded files one by one.

Closes #25184

**Original Pull Request:** https://github.com/langgenius/dify/pull/25185 **State:** closed **Merged:** Yes --- ## Summary This PR improves the type checking configuration by resetting Pyright to strict mode and adding mypy to the CI pipeline. ## Changes - Reset `pyrightconfig.json` to strict mode with temporary file exclusions instead of rule suppressions - Add mypy type checker to CI workflow for additional coverage - Fix type issues in affected files: - `app_factory.py`: Capture decorator return value to avoid unused function warning - `chunk_merger.py`: Add proper type casting for merged messages - `tool_manager.py`: Fix lambda function attribute access - `dataset_service.py`: Add proper return statement for error case - `builtin_tools_manage_service.py`: Fix lambda function attribute access ## Motivation The previous Pyright configuration ignored too many rules, reducing type checking effectiveness. This change establishes a stricter baseline that we can incrementally improve by fixing excluded files one by one. Closes #25184
yindo added the pull-request label 2026-02-21 20:48:33 -05:00
yindo closed this issue 2026-02-21 20:48:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#30961