-
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
Merged
Merged
Switch to Ruff #372
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
349a140
switch black,autoflake,flake8,isort to ruff
jhkennedy dbe1b2b
ruff format and check --fix
jhkennedy 7c2dc50
manual fixes for issues raised by ruff check
jhkennedy c451ff0
fix fixes
jhkennedy 7057173
poetry is weird yo
jhkennedy ccd14ac
Add github action for ruff
jhkennedy 6fa4aee
fix whitespace
jhkennedy 9845607
Update pyproject.toml
jhkennedy e5899f5
Apply suggestions from code review
jhkennedy 7b2d5d1
reformat for lw=88
jhkennedy 7ed8385
ruff everything!
jhkennedy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Lint and Format with Ruff | ||
|
||
on: push | ||
|
||
jobs: | ||
check-with-ruff: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install ruff | ||
|
||
- name: Ruff linting check | ||
run: | | ||
ruff check --output-format=github . | ||
|
||
- name: Ruff format check | ||
run: | | ||
ruff format --diff . |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ build/ | |
*.egg-info/ | ||
docs/tutorials/data | ||
tests/integration/data | ||
.ruff_cache | ||
|
||
# OS X | ||
.DS_Store | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,14 @@ | |
from typing import Any, Dict, List, Optional, Union | ||
from uuid import uuid4 | ||
|
||
import earthaccess | ||
import fsspec | ||
import requests | ||
import s3fs | ||
from multimethod import multimethod as singledispatchmethod | ||
from pqdm.threads import pqdm | ||
|
||
import earthaccess | ||
|
||
from .auth import Auth | ||
from .daac import DAAC_TEST_URLS, find_provider | ||
from .results import DataGranule | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if len(granule.data_links()) > 1: | ||
print( | ||
"Warning: This collection contains more than one file per granule. " | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
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