feat: add ruff (as formatting and linting) #3
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.
Overview
This pull request introduces and configures Ruff (Python linter and formatter) for the project. The primary goal is to automate code styling and linting to improve overall code quality, consistency, and developer productivity.
You can check your codes by
uv run ruff check, or fix with--fixoption.Key Changes
The Ruff configuration has been added to
pyproject.tomlwith the following key settings:1. Formatter Configuration (
[tool.ruff.format])79characters is enforced.").2. Linter Configuration (
[tool.ruff.lint])select): The linter is configured to check for:C: Code complexity (fromflake8-comprehensions,mccabe)E: Style guide violations (frompycodestyle)F: Logical errors (fromPyflakes)S: Potential security issues (fromflake8-bandit)U: Modern Python syntax suggestions (frompyupgrade)I: Import sorting issues (fromisort)ignore):C901: Ignores "function too complex" warnings, which can be addressed in future refactoring.E501: Ignores "line too long" warnings, as this is handled automatically by the formatter.isortConfiguration:pydocstyleConfiguration: