Skip to content

Conversation

@Jitterx69
Copy link

Summary

This PR modernizes the project's CI/CD pipeline by integrating ruff for high-performance linting and mypy for static type checking. It also includes an initial refactor of the core awscli/clidriver.py module to demonstrate these improvements, resolving legacy formatting issues and adding strict type hints.

Key Changes

  • CI/CD Pipeline: Updated scripts/ci/run-check to enforce linting (ruff) and type safety (mypy).
  • Dependencies: Added ruff and mypy to requirements-check.txt.
  • Configuration: Added a safe [tool.mypy] configuration to pyproject.toml that allows for incremental adoption (follow_imports = "silent").
  • Refactoring (awscli/clidriver.py):
    • Replaced legacy % string formatting with modern f-strings.
    • Added return type annotations to critical entry points: main(), create_clidriver(), and CLIDriver.main().
    • Fixed all strict linting violations.

Motivation

To improve long-term code maintainability and prevent type-related runtime errors. Use of modern tooling (ruff) ensures these checks remain fast, while mypy integration lays the groundwork for a fully typed codebase.

Testing

  • Static Analysis: ruff and mypy checks pass with 0 errors on the modified files.
  • Unit Tests: Ran tests/unit/test_clidriver.py locally; all 54 tests passed, ensuring no functional regressions.

This commit introduces 'ruff' for linting and 'mypy' for static type checking into the CI pipeline (scripts/ci/run-check).

- Updated requirements-check.txt to include ruff and mypy.

- Added [tool.mypy] configuration to pyproject.toml.

- Refactored awscli/clidriver.py to fix legacy formatting and add strict type hints to core functions.

- Added OSC documentation.
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.

1 participant