Repository navigation
Replace struphy format/lint with plain ruff - #730
Merged
Merged
Conversation
- Remove `struphy format` and `struphy lint` (src/struphy/console/format.py)
and the OpenMP `# $` pragma check (pyccel now accepts the space).
- Move the __init__.py generation to struphy/console/build_init_files.py;
`struphy build-init-files` formats the result with ruff.
- Enable ruff's isort rules ("I") and drop isort, autopep8, flake8, pylint,
ssort, add-trailing-comma and tabulate from the dev extra; add ruff.
- CI: remove struphy_lint_all and isort jobs; run `ruff format --check` and
`ruff check` on GitHub and GitLab.
- Apply ruff format/import sorting to tutorials, doc, utils and profiling.
- Document formatting and import sorting in the developer's guide.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
max-models
added this pull request to stack #733
October 8, 2026 07:08
max-models
marked this pull request as draft
October 8, 2026 09:06
max-models
marked this pull request as ready for review
October 8, 2026 09:06
spossann
approved these changes
Oct 8, 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.
Summary
struphy lintonly enforcedruff format, ruff's import sorting (ruff check --select I) and a check for# $OpenMP pragmas.struphy formatonly ran those two ruff commands in a loop. This PR drops both commands and uses ruff directly.Changes
struphy formatandstruphy lint. This deletessrc/struphy/console/format.py(~1550 lines) and its test.# $check. pyccel now accepts a space after#in OpenMP pragmas.struphy build-init-filesmoved tosrc/struphy/console/build_init_files.py. It still regeneratesmodels/,propagators/andgeometry/domains/__init__.py, then sorts imports and formats them with ruff. Its--linters,--iterationsand-yoptions are removed. The package folders are now found relative to the installed package rather than the current working directory.extend-select = ["I"]inpyproject.toml), replacing isort.autopep8,isort,flake8,pylint,ssort,add-trailing-commaandtabulate, and addedruff==0.15.0. Also removed the[tool.autopep8],[tool.isort]and[tool.pylint]config sections and the[flake8]section insetup.cfg.struphy_lint_allandisortjobs. Theruffjob now runsruff format --checkandruff check; until nowruff format --checkwas commented out.struphy lintjobs are replaced by oneruffjob.struphy lintonly coveredsrc/, so I ranruff check --fixandruff formatontutorials/,doc/,utils/andprofiling/. That's 25 files, all automatic fixes.struphy build-init-files.How to format now
Testing
ruff format --checkandruff checkpass on the whole repo.struphy build-init-filesreproduces the committed__init__.pyfiles exactly.test_state.pyandtest_params_profile.pypass.🤖 Generated with Claude Code