(chore): Update to Ruff 0.9 and add EM lints#1825
Merged
Merged
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1825 +/- ##
==========================================
- Coverage 87.09% 83.64% -3.46%
==========================================
Files 40 40
Lines 6138 6267 +129
==========================================
- Hits 5346 5242 -104
- Misses 792 1025 +233
🚀 New features to boost your workflow:
|
flying-sheep
commented
Jan 13, 2025
| rev: v0.9.1 | ||
| hooks: | ||
| - id: ruff | ||
| types_or: [python, pyi, jupyter] |
Member
Author
There was a problem hiding this comment.
This has since become the default for Ruff, so we can remove it
Comment on lines
-181
to
+182
| "TCH", # manage type checking blocks | ||
| "TC", # manage type checking blocks |
Member
Author
There was a problem hiding this comment.
This has been renamed by Ruff
Comment on lines
-178
to
+179
| raise KeyError( | ||
| "'{key!r}' not found in view of {self.attrname}" | ||
| ) # Make sure it exists before bothering with a copy | ||
| msg = f"'{key!r}' not found in view of {self.attrname}" | ||
| raise KeyError(msg) # Make sure it exists before bothering with a copy |
Member
Author
There was a problem hiding this comment.
I spotted this error: There was an f missing, so this error message was pretty useless
| validate(default_value) | ||
| except (ValueError, TypeError) as e: | ||
| add_note(e, f"for option {repr(option)}") | ||
| add_note(e, f"for option {option!r}") |
Member
Author
There was a problem hiding this comment.
I changed this to use the format specifier !r instead of repr. (and did the same ~2 other times)
Comment on lines
-11
to
+12
| from anndata import AnnData, ImplicitModificationWarning, read_h5ad, read_loom | ||
| from anndata import AnnData, ImplicitModificationWarning, read_h5ad | ||
| from anndata.io import read_loom |
Member
Author
There was a problem hiding this comment.
Independent driveby fix, sorry!
ilan-gold
approved these changes
Jan 14, 2025
flying-sheep
added a commit
that referenced
this pull request
Jan 16, 2025
flying-sheep
added a commit
that referenced
this pull request
Jan 16, 2025
flying-sheep
added a commit
that referenced
this pull request
Jan 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Since Ruff 0.9 touches a bunch of Exception instantiations, I thought adding the EM lints now is a good time. See #1241
The coverage issues are expected as we don’t test some just-in-case exception raisings. So a PR touching many spots that involve instantiating exceptions will have low coverage.