-
Notifications
You must be signed in to change notification settings - Fork 84
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
Switch to Ruff #372
Switch to Ruff #372
Conversation
👈 Launch a binder notebook on this branch for commit 7057173 I will automatically update this comment whenever this PR is modified 👈 Launch a binder notebook on this branch for commit ccd14ac 👈 Launch a binder notebook on this branch for commit 6fa4aee 👈 Launch a binder notebook on this branch for commit 9845607 👈 Launch a binder notebook on this branch for commit e5899f5 👈 Launch a binder notebook on this branch for commit 7b2d5d1 👈 Launch a binder notebook on this branch for commit 7ed8385 |
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.
Looks like this workflow doesn't run here b/c it was added on a fork -- you can see it run in my fork here:
https://github.com/jhkennedy/earthdata/actions/workflows/static-analysis.yml
I added this in addition to it in the pre-commit because it will annotate the PR, which you can see in this PR:
https://github.com/ASFHyP3/hyp3-isce2/pull/156/files
@@ -51,7 +52,7 @@ def _open_files( | |||
) -> List[fsspec.AbstractFileSystem]: | |||
def multi_thread_open(data: tuple) -> EarthAccessFile: | |||
urls, granule = data | |||
if type(granule) is not str: | |||
if not isinstance(granule, str): |
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.
$ ruff check earthaccess tests
earthaccess/store.py:55:12: E721 Do not compare types, use `isinstance()`
Co-authored-by: Matt Fisher <mfisher87@gmail.com>
Co-authored-by: Matt Fisher <mfisher87@gmail.com>
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.
I would prefer to remove the repeated (and I think unneeded) earthaccess tests
arguments to ruff. If you prefer not to do that in this PR, we can always get it in another one.
@mfisher87 switched |
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.
Thanks! Looks amazing :) 💯
this resolves #341 by dropping autoflake, black, flake8, and isort in favor of ruff
There were some minor issues caught by ruff that I fixed as well as some differences in formatting, which IMO are improvements (this is subjective).
Notably, flake8 had a line length set at 120 while isort had it set at 88. With ruff, those are both set at 120 and there are some white-space changes, especially around unnecessarily breaking things that are shorter than 120.
I've noted any changes that are more than whitespace in the PR.