Improve code quality with type hints, docstrings, and linting - #23
Merged
Merged
Conversation
uv venv does not install pip into the virtualenv. Use `VIRTUAL_ENV=... uv pip install` to install the wheel into the smoke-test venv. https://claude.ai/code/session_01Mh9N715DtHCyzoUDicjVea
The heredoc body (<!DOCTYPE html>...) had no indentation, breaking out of the YAML block scalar which requires consistent indentation. Replace with a single printf call. https://claude.ai/code/session_01Mh9N715DtHCyzoUDicjVea
The CI lint step runs `uv run ruff check` but ruff was not listed in the dependency-groups.dev section of pyproject.toml, causing the command to fail with "No such file or directory". https://claude.ai/code/session_01Mh9N715DtHCyzoUDicjVea
Add type annotations, docstrings, and fix lint issues to satisfy the strict ruff configuration (ANN, D, E, F, B, I, UP, W rules). All 2895 errors resolved with zero regressions (1021 tests pass). Key changes: - Add missing type annotations (ANN001/ANN201/ANN202/ANN204/ANN205) - Replace Any with concrete types where possible (ANN401) - Add docstrings to all public classes, methods, functions, packages - Fix undefined names (F821) by adding missing imports - Fix line-too-long (E501), unused variables (F841) - Add noqa comments for intentionally deferred imports (E402) - Fix raise-without-from (B904), unused loop vars (B007) - Auto-format with ruff format https://claude.ai/code/session_01Mh9N715DtHCyzoUDicjVea
Rich/typer renders ANSI escape codes in help output that differ between Python versions. Strip ANSI codes before asserting on flag presence in help text. https://claude.ai/code/session_01Mh9N715DtHCyzoUDicjVea
… installation and linting
…rove version handling
…options and validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves overall code quality through comprehensive type annotations, docstring additions, and code style improvements across the codebase. The changes focus on enhancing maintainability and consistency without altering functionality.
Key Changes
Type Annotations & Imports
Anyimports with specific types orTYPE_CHECKINGguards where appropriateGenerator,Iterator,Callable, and othercollections.abcimports for better type specificityTYPE_CHECKINGblocks to avoid circular imports while maintaining type safetyDocstrings
__init__.pyfiles"""Tests for TestStatusCommand.""")Code Style & Formatting
Infrastructure
ruff>=0.11.0to dev dependencies for linting supportNotable Implementation Details
str | Noneinstead ofOptional[str])TYPE_CHECKINGprevent circular dependencies while preserving IDE supporthttps://claude.ai/code/session_01Mh9N715DtHCyzoUDicjVea