Fix 10 bugs identified by ruff: undefined name, variable shadowing, and import organization#39
Merged
Merged
Conversation
Co-authored-by: zhubonan <33688599+zhubonan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add code bug scanning for repository
Fix 10 bugs identified by ruff: undefined name, variable shadowing, and import organization
Feb 15, 2026
zhubonan
reviewed
Mar 6, 2026
| # Using sumo interface | ||
| try: | ||
| from aiida_abacus.common.sumo_kpath import kpath_from_sumo_v2 | ||
| from aiida_abacus.common.sumo_kpath import kpath_from_sumo_v2 # noqa: PLC0415 |
Collaborator
There was a problem hiding this comment.
@copilot remove the noqa statement as they are not enabled
Contributor
Author
There was a problem hiding this comment.
Removed in commit b1ad68e. The PLC0415 rule is not triggered by ruff 0.4.3 (the project's version), so the noqa comments were unnecessary.
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.
Bug Fixes for aiida-abacus Repository
Summary
Successfully identified and fixed all 10 linter errors in the aiida-abacus repository. All fixes have been validated and security scanned.
Bugs Identified and Fixed:
TrajectoryDataimport in calculations.py (line 180)TrajectoryDatatoorm.TrajectoryDatato match usage pattern in parserspseudo_pathparameter redefinedpseudo_folderto avoid shadowing the parametercutoff_rhounpacked but never used_cutoff_rhoto mark as intentionally unused__all__list in protocols/generator.py (line 24)collectionsimport to top of filePortNamespaceimport to top of fileSecurity Summary
✅ No security vulnerabilities identified by CodeQL scanner
Files Modified
src/aiida_abacus/calculations.py- Fixed undefined TrajectoryDatasrc/aiida_abacus/group/orb_group.py- Fixed variable shadowingsrc/aiida_abacus/workflows/base.py- Fixed unused variable, removed noqa commentssrc/aiida_abacus/protocols/generator.py- Fixed unsorted allsrc/aiida_abacus/common/__init__.py- Fixed imports locationsrc/aiida_abacus/workflows/band.py- Removed noqa comments💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.