-
Notifications
You must be signed in to change notification settings - Fork 12
Add ruff linting and formatting configuration #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces ruff as a linting and formatting tool for the codebase and applies automated cleanup to address various code quality issues including unused imports, unused variables, and style violations.
Key changes:
- Added ruff configuration in
.ruff.tomlwith Python 3.12 target, 79-character line length, and selective rule ignores - Updated
pyproject.tomlto addruff>=0.14.5,pytest, andpre-commitas dev dependencies - Applied automated code cleanup across multiple files to remove unused imports/variables and fix style issues
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.ruff.toml |
New ruff configuration file with sensible defaults for the project |
pyproject.toml |
Added dev dependency group with ruff, pytest, and pre-commit |
uv.lock |
Updated lock file with new dependencies including ruff, pre-commit, and their transitive dependencies |
tests/spin_one_half_test.py |
Removed unused variable p |
tests/name_injection_test.py |
Added noqa: F821 comments for intentionally undefined names from injection |
tests/genquad_test.py |
Removed unused pytest import |
drudge/utils.py |
Removed unused ManagedProperties import |
drudge/nuclear.py |
Reordered variable assignments to avoid unused variable warnings |
drudge/drudge.py |
Fixed style issues: != to is not, lambda to def, added missing import in docstring |
docs/conf.py |
Added noqa: E402 for module-level import after other code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 47 out of 49 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
drudge/su2.py:1
- Extra trailing comma creates a single-element tuple for phase assignment. This should be
phase = _NEG_UNITY ** (JOf(k2) + mk2)without the trailing comma.
"""Drudge for SU(2) Lie algebra."""
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Pull Request Test Coverage Report for Build 19417954037Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Use
rufffor linting and formatting. Clean up the codebase.