chore: fix findings from latest ruff, add lint CI - #242
Open
Solmath wants to merge 4 commits into
Open
Conversation
…nd manual fixes * refactoring imports * replacing optional * pass tz to `datetime.now()` * add justification for blind exception * update types in '__aenter__` and `__aexit__`
Solmath
marked this pull request as ready for review
August 15, 2026 15:16
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.
Why this PR
There is currently no lint step in CI, so nothing checks whether a
ruffversion bump changes what gets flagged. I forgot to runpoetry syncafterruffwas bumped to0.16.2inpyproject.toml, so my local venv was still on an older version (0.14.2) and had never actually run the pinned one. Once I synced, the new default rule set turned up a batch of findings acrossaiostreammagic/andexamples/that nobody had seen before, because pre-commit only ever ran against whatever ruff happened to be installed in each contributor's venv.This PR:
except,Self/TracebackTypetyping on__aenter__/__aexit__, and adict.keys()cleanup) - see the commit messages for details..github/workflows/lint.ymlso aruff/mypyregression like this shows up on the PR that introduces it (including Dependabot's own version-bump PRs), instead of staying invisible until someone happens to sync their venv.Suggestion for a follow-up
Right now
.pre-commit-config.yamlruns ruff as arepo: localhook (entry: poetry run ruff check --fix), so its version depends on whatever is installed in each contributor's venv rather than a pinned, isolated environment. That is what let this go unnoticed for so long. Switching to the official ruff-pre-commit hook with a pinnedrevwould fix that. I would keepmypyas a local hook, since it needs the project's own dependencies installed to resolve types. Happy to open that as a separate PR if useful.