Use only ruff for Python linting and formatting #1202
Merged
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 updates the template files to match what was successfully used in sot/kadi#268.
One slight departure from the "ruff-only" theme is moving the
pyright
configuration into its dedicated JSON file. There is a question about whether it is better to glop all tool config into onepyproject.toml
file or use separate config files where possible. For this application where we want to apply the same files to many projects, I believe that having separate config files works better. If we want to apply a mass update then it is just a matter of copying a new file (e.g.ruff.toml
) instead of editing a section inpyproject.toml
.Testing
The files were successfully used in sot/kadi#268, including inadvertent lint/format mistakes that ended up triggering pre-commit and GitHub action failures (both format and lint for each case).
I also confirmed that the new
pyrightconfig.json
file successfully forcespyright
in VS code to ignore notebooks. Without that file I see spuriouspyright
errors in the notebook (e.g. "Unresolved import" forcxotime
which is clearly wrong).