Add ruff workflow and enforce stricter linting rules#433
Merged
Conversation
eirikurj
marked this pull request as draft
April 7, 2026 11:21
eirikurj
requested review from
A-CGray and
timryanb
and removed request for
A-CGray
April 7, 2026 15:45
Contributor
* fix F401 re-export __all__ desyncs
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* replace star imports with explicit imports (F403/F405)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix E402 import placement
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix F821 undefined names
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix F841 unused variables (mechanical cleanup + getLocalCoords refactor)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* support kcorr in IsoShellConstitutive and use PSHELL TST factor
Add a shear-correction-factor (kcorr) constructor argument to
IsoShellConstitutive (default 5/6, mirroring CompositeShellConstitutive)
and pass the PSHELL TST field through to it in pyTACS, instead of reading
TST into a dead local. Previously the BDF shear-correction factor was
silently ignored for isotropic shells.
Requires a full rebuild (C++ + Cython interface); not buildable/testable
in the current environment.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* remove dead unused locals (F841)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix StaticProblem.setOption to skip solver recreation on tolerance change
The L2Convergence-update branch set a dead local `createVariables = False`
that was never read; the flag actually consulted before recreating the
linear solver is `recreateSolver`. Setting `recreateSolver = False` here
skips the redundant `self._createSolver()` call when only the convergence
tolerance changed (the tolerance is already updated in place via
setTolerances), matching the intent of the dead flag.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* pass struct_options to static problem in thermal IC test
The struct_options dict ({"L2Convergence": 1e-16}, commented as the finer
tolerance needed to pass the complex-step sensitivity test) was built but
never passed to any problem. L2Convergence is a problem-level option, so
forward it to createStaticProblem (mirroring the transient problem's
options= usage in the same test).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* avoid mutable default arguments (B006)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix unused loop control variables (B007)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* bind loop variables to avoid late-binding closures (B023)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* add stacklevel to warnings.warn calls (B028)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chain exceptions with 'from err' (B904)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix E712/E731/W293 lint issues
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix F401 re-export __all__ desyncs in merged modules
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* remove unused imports from merged code (F401)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* remove duplicate PT import (E402/F811)
Consolidate the test_rectangle_beam_tractions import to the top import
block (including ksweight) and drop the late duplicate that the upstream
merge reintroduced.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* fix docstring section/quote formatting (D409/D209)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* another import fix
* Regenerate reference matvec results due to slight `kcorr` change
* renaming for clarity
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Eirikur Jonsson <eirikurj@umich.edu>
eirikurj
marked this pull request as ready for review
June 27, 2026 11:49
A-CGray
approved these changes
Jun 29, 2026
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.
Description
This PR replaces
blackwith aruffformatting and linting CI workflow.The defaults for formatting should be the same as the ones found in
black. For example, the default line length is 88 characters.The
rufflinting rules are added to thepyproject.tomlfile along with some common exceptions. The linting exceptions are minimal but necessary in my opinion, but there are some there that we might want to work on getting removed in the future.Note, currently there are tests and examples that will fail the linting and need attention. In some cases its not clear what the author's intent was, and in others more extensive refactoring could be done (e.g.
setup_tacs_vecsis largly the same in many tests and could be shared across many).Closes #429