MNT: Switch linting to ruff #124
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.
This switches over from pycodestyle + pylint to ruff. The codes aren't exactly 1-1, but we can add more/less as desired (there are lots of options https://docs.astral.sh/ruff/rules/). I tried to just use some basic ones for now that keeps it pretty similar. One nice thing is the addition of pyupgrade checks that caught some unneeded typing usages where we can use the builtins now.
On IMAP, we use pre-commit.ci for our linting checks instead of a GitHub Action to separately tell us whether it is linting or tests failing. We can add that and add some more rules like codespell later if those are desired too.
https://github.com/IMAP-Science-Operations-Center/imap_processing/blob/dev/.pre-commit-config.yaml
You can run
ruff check --fix space_packet_parser
to automatically fix many issues.Some notes:
Checklist