-
Notifications
You must be signed in to change notification settings - Fork 139
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
Enable Ruff formatting #1655
Enable Ruff formatting #1655
Conversation
line-length=88 for docs, line-length=120 for everything else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just using this PR draft to look through changes and note blocks where code formatting should be disabled (e.g., visualising 2D arrays, or long equations) or code should be refactored.
Will force push and rework the commits in this PR with the changes after I've some some refactoring in fieldset.py
in another PR
Co-authored-by: Erik van Sebille <[email protected]>
Technically ISC001 is "incompatible" with ruff format https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules, but this just means that running Ruff format can introduce an ISC001 error. Bugfix ValueError message due to improper use of implicit concat
@erikvansebille I was wanting to run some tests locally, but got an error about not finding the compiler. I exported
|
No, haven't seen his specific error before. But I normally do |
Enable Ruff formatting for all Python files in codebase. Line length 88 for
docs/*
, 120 for the rest.This PR is intended to isolate these changes (since they're non-breaking, but create a large diff), as well as to act as a place to flag any changes that are unreadable and would benefit from refactoring before being merged.
If a file is particularly bad, we can add them to an exclude list.
To disable the formatter for certain parts of the code, you can add comments to suppress the formatter.
See related discussion in #1653. Contributes to #1620