-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
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
-
ruffis added as a development dependency and configured inpyproject.toml. -
mypyis added as a development dependency and configured inpyproject.toml. - Existing code is updated to pass all linting and type-checking rules.
- A
make lintor similar command is available for local verification. - Documentation is updated to include the coding standards and how to run the tools.
Proposed Technical Details
- Use
ruffto replace multiple tools (flake8, autoflake, etc.) for performance and simplicity. - Configure
ruffrules to be strict but pragmatic (e.g., following theB,E,F, andIrule sets). - Set up
mypywithstrict = trueor a similar high-standard configuration to ensure type safety. - Update
pyproject.tomlsections for[tool.ruff]and[tool.mypy].
Tasks
- Add
ruffandmypytorequirements.txt(or a newrequirements-dev.txt). - Configure
ruffinpyproject.toml. - Configure
mypyinpyproject.toml. - Run
ruff check . --fixto address auto-fixable issues. - Manually fix remaining linting violations.
- Fix type-checking errors reported by
mypy. - Update
README.mdwith instructions for running linting tools.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels