Problem
The project currently uses black and isort for formatting, but lacks a comprehensive linter and consistent type-checking. This can lead to subtle bugs, inconsistent coding patterns, and poor maintainability as the codebase grows. There is no automated enforcement of these standards outside of the newly planned CI workflow.
Proposed Solution
Standardize the project's code style by adopting a modern linter (e.g., ruff) and fully configuring mypy for static type analysis. Update pyproject.toml to serve as the single source of truth for all linting and formatting configurations.
User Stories
- As a developer, I want clear feedback on code quality and style violations as I write code.
- As a reviewer, I want to spend less time on stylistic comments and more time on logic and architecture.
Acceptance Criteria
Proposed Technical Details
- Use
ruff to replace multiple tools (flake8, autoflake, etc.) for performance and simplicity.
- Configure
ruff rules to be strict but pragmatic (e.g., following the B, E, F, and I rule sets).
- Set up
mypy with strict = true or a similar high-standard configuration to ensure type safety.
- Update
pyproject.toml sections for [tool.ruff] and [tool.mypy].
Tasks
Problem
The project currently uses
blackandisortfor formatting, but lacks a comprehensive linter and consistent type-checking. This can lead to subtle bugs, inconsistent coding patterns, and poor maintainability as the codebase grows. There is no automated enforcement of these standards outside of the newly planned CI workflow.Proposed Solution
Standardize the project's code style by adopting a modern linter (e.g.,
ruff) and fully configuringmypyfor static type analysis. Updatepyproject.tomlto serve as the single source of truth for all linting and formatting configurations.User Stories
Acceptance Criteria
ruffis added as a development dependency and configured inpyproject.toml.mypyis added as a development dependency and configured inpyproject.toml.make lintor similar command is available for local verification.Proposed Technical Details
ruffto replace multiple tools (flake8, autoflake, etc.) for performance and simplicity.ruffrules to be strict but pragmatic (e.g., following theB,E,F, andIrule sets).mypywithstrict = trueor a similar high-standard configuration to ensure type safety.pyproject.tomlsections for[tool.ruff]and[tool.mypy].Tasks
ruffandmypytorequirements.txt(or a newrequirements-dev.txt).ruffinpyproject.toml.mypyinpyproject.toml.ruff check . --fixto address auto-fixable issues.mypy.README.mdwith instructions for running linting tools.