aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

chore: integrate ruff and mypy for CI/CD modernization

Open Jitterx69 opened this issue 3 weeks ago • 0 comments

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.

Jitterx69 avatar Dec 05 '25 12:12 Jitterx69