Add ruff linting and formatting configuration#49
Merged
chenpeizhi merged 14 commits intomasterfrom Nov 17, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 |
Contributor
There was a problem hiding this comment.
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 |
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.
Use
rufffor linting and formatting. Clean up the codebase.