Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ruff to v0.8 #6634

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Bump ruff to v0.8 #6634

merged 1 commit into from
Dec 2, 2024

Conversation

danielhollas
Copy link
Collaborator

Builds on top of #6614, which should be reviewed and merged first.

I've pushed this as a separate PR for easier review. Marking this as draft until then.

Most of the changes here come from a new rule RUF022

 unsorted-dunder-all (RUF022)

Derived from the **Ruff-specific rules** linter.

Fix is sometimes available.

## What it does
Checks for `__all__` definitions that are not ordered
according to an "isort-style" sort.

An isort-style sort orders items first according to their casing:
SCREAMING_SNAKE_CASE names (conventionally used for global constants)
come first, followed by CamelCase names (conventionally used for
classes), followed by anything else. Within each category,
a [natural sort](https://en.wikipedia.org/wiki/Natural_sort_order)
is used to order the elements.

@unkcpz unkcpz self-requested a review November 27, 2024 15:13
@danielhollas danielhollas marked this pull request as ready for review December 2, 2024 12:35
@danielhollas
Copy link
Collaborator Author

@unkcpz this is now ready for review

Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

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

Thanks, looks all good!
I remember two weeks ago I sometime to check how to have both isort and ruff for my neovim. Now everything is in ruff!

@danielhollas
Copy link
Collaborator Author

To be clear, ruff was already doing what isort does, i.e. ordering import statements. This new rule that sorts the __all__ = expressions is not implemented in isort (I don't think).

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.89%. Comparing base (ef60b66) to head (eb29442).
Report is 152 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6634      +/-   ##
==========================================
+ Coverage   77.51%   77.89%   +0.39%     
==========================================
  Files         560      567       +7     
  Lines       41444    42180     +736     
==========================================
+ Hits        32120    32853     +733     
- Misses       9324     9327       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@unkcpz unkcpz merged commit 333992b into aiidateam:main Dec 2, 2024
10 checks passed
@danielhollas danielhollas deleted the bump-ruff-0.8 branch December 2, 2024 19:47
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