Skip to content

Various fixes for issues flagged by the 'ruff check' linter. #37

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

jaharkes
Copy link
Member

Fixes are all over the place and who knows how much got broken as a result.

I read through the diff a few times now and it mostly looks reasonable, but I guess people should at least look it over.
Alternatively, it may be useful to cherry pick some of the specific commits that actually fix obvious errors and leave some of the reordering of imports to the formatter.

Once a ruff format is done and merged, it is probably fine to re-enable E501 (long lines) and E701 (multiple statements on one line) because most of those should get fixed by reformatting.

Over time more checks can be enabled, like CPY (if all files have the copyright blurbs) and PTH (use Path instead of os.path), enabling all checks (after formatting) flags 4388 issues, but that includes a lot of nice to have but not critical things like missing docstrings and type annotations.

@@ -31,7 +30,7 @@ def clear_compute_result(self, compute_id):
self._result_cache.pop(compute_id, None)

######################################################## COMPUTE ############################################################
def get_compute_result(self, compute_id, result_type: str) -> Optional[Union[None, tuple]]:
def get_compute_result(self, compute_id, result_type: str) -> None | tuple | None:
Copy link
Member Author

Choose a reason for hiding this comment

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

This weird type annotation is fixed by a later commit.

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.

1 participant