Skip to content

Conversation

@codegen-sh
Copy link
Contributor

@codegen-sh codegen-sh bot commented Jul 24, 2025

This PR addresses multiple linting errors and warnings identified in the codebase:

Changes Made

Async Function Cleanup (RUF029)

  • Removed async keyword from functions that don't use async features:
    • validate_core_protocols() in validation/validation_demo.py
    • validate_source_factory() in validation/validation_demo.py
    • validate_configuration_system() in validation/validation_demo.py
    • validate_backward_compatibility() in validation/validation_demo.py
    • migrate_config_to_extensible() in src/codeweaver/server.py

Logging Exception Handling (TRY401)

  • Fixed redundant exception objects in logging.exception calls:
    • src/codeweaver/sources/integration.py lines 102 and 157
    • Removed exception object parameter since logging.exception automatically includes exception info

Boolean Parameter Handling (FBT001)

  • Added keyword-only parameters for boolean arguments:
    • migrate_config_to_extensible(): enable_plugins parameter
    • ServerMigrationManager.perform_migration(): backup_components parameter

Code Quality Improvements

  • Removed unused variable e in exception handler (F841)
  • Updated validation runner to handle both sync and async functions using inspect.iscoroutinefunction()

Files Modified

  • src/codeweaver/server.py
  • src/codeweaver/sources/integration.py
  • validation/validation_demo.py

All changes maintain backward compatibility while improving code quality and following Python best practices.


💻 View my work🚫 Ban all checks • 👤 Initiated by @bashandboneAbout Codegen

- Remove async keyword from functions that don't use async features
- Fix TRY401 issues by removing redundant exception objects from logging.exception calls
- Add keyword-only parameters for boolean arguments to fix FBT001 issues
- Remove unused variable in exception handler
- Update validation runner to handle both sync and async functions
@bashandbone bashandbone merged commit b4e3b45 into main Jul 24, 2025
2 checks passed
@bashandbone bashandbone deleted the codegen-bot/fix-linting-errors-1753333088 branch July 24, 2025 10:14
Copilot AI added a commit that referenced this pull request Nov 12, 2025
…dling

Fixes from Claude's code review:

1. Fixed deleted files path conversion (Issue #1 - CRITICAL)
   - Convert relative paths from manifest to absolute paths for cleanup
   - Check if project_root is set before conversion
   - Prevents silent failures in deleted file cleanup

2. Fixed async lock initialization (Issue #2)
   - Initialize _manifest_lock as None in __init__ (sync context)
   - Lazily create lock in async methods (_index_file, _delete_file)
   - Prevents potential RuntimeError in certain execution contexts

3. Null checks already in place (Issue #3)
   - All manifest operations already check for lock existence
   - No changes needed

All 36 tests passing.

Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.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.

2 participants