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

Add ruff code formatting and linting github action #170

Merged
merged 11 commits into from
Mar 26, 2024
Merged

Conversation

bdpedigo
Copy link
Collaborator

@bdpedigo bdpedigo commented Mar 21, 2024

see #169

this adds a formatting enforcement test to the build on pull or push to master

@bdpedigo
Copy link
Collaborator Author

@ceesem this is another option https://pre-commit.com/

and v is not None
and a.metadata.get("is_bbox", False) == False
and a.metadata.get("is_meta", False) == False
and a.metadata.get("is_bbox", False) == False # noqa E712
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

could just fix these... but unsure whether this get could return a string, and then things get weird... so i opted to just tell it to shut up for these, and hopefully in the future we can just follow the linting

@@ -78,10 +79,9 @@ def get_all_view_metadata(client):
def is_list_like(x):
if isinstance(x, str):
return False
try:
len(x)
if hasattr(x, "__len__"):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this should be the same functionality but happy to change it back and noqa it if anyone is concerned

@@ -18,7 +20,7 @@ class TestInfoClient:

@responses.activate
def test_infoclient(self, myclient, mocker):
endpoint_mapping = self.default_mapping
endpoint_mapping = self.default_mapping # noqa F841
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ceesem this is giving F841 Local variable endpoint_mapping is assigned to but never used but i opted to leave it because of what we just discussed w pytest. lmk if you think this is really not used, though

@bdpedigo bdpedigo requested review from ceesem and fcollman March 22, 2024 23:42
@fcollman fcollman merged commit 73be62d into master Mar 26, 2024
16 checks passed
@bdpedigo bdpedigo deleted the ruff-action branch March 26, 2024 21:34
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