Skip to content

Conversation

greglucas
Copy link
Collaborator

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:

  • Imports are sorted
  • Removed assertions within main codebase and changed to raising errors now
  • Changed pytest to automatically error on warnings

Checklist

  • Changes are fully implemented without dangling issues or TODO items
  • Deprecated/superseded code is removed or marked with deprecation warning
  • Current dependencies have been properly specified and old dependencies removed
  • New code/functionality has accompanying tests and any old tests have been updated to match any new assumptions
  • [n/a] The changelog.md has been updated

@greglucas greglucas requested a review from medley56 as a code owner February 4, 2025 14:20
Copy link
Member

@medley56 medley56 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@medley56 medley56 merged commit d0a608d into lasp:main Feb 4, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants