Repository navigation
Adopt the shared ruff rule set and configure ty - #45
Merged
Merged
Conversation
[tool.ruff.lint] now selects E, F, W, I, UP and B (E501 left to the formatter), with E402 allowed in tutorials/examples and F401 in __init__.py. The rest of this commit is `ruff check --fix` (plus the semantics-preserving unsafe fixes for `zip(strict=False)`, `X | None` annotations and printf formatting) and `ruff format`. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
- lazy_ops.py: `LazyOp` as a `|` union instead of `typing.Union`. - array.py: f-string in the chunk-alignment assert. - pgsql_graph_database.py: the `__sql_type` lookup raises KeyError, not ValueError, so the except clause never fired; it now catches KeyError and raises NotImplementedError `from None` as intended. - tests: `is True`/`is False` instead of `==`; the bare `except:` around the element-wise comparison names the two exceptions it handles; the six blind `pytest.raises(Exception)` carry a noqa with the reason (the duplicate-write error is backend-specific). Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
[tool.ty.src] names the checked scope (src, tests). The mypy overrides table and types-networkx/types-toml are gone (types-psycopg2 stays: psycopg2 ships no inline types and ty reads the stub). Of the ten diagnostics: to_world_space's return annotation now includes the ndarray it returns for plain sequences; the PostgreSQL info query asserts fetchone() returned a row; psycopg2.errors is imported explicitly; the mypy-era `type: ignore` comments on the OME metadata construction, the lazy-op narrowing and the iohub AxisMeta alias become `ty: ignore[<rule>]` with their reasons; the networkx overload ignore is no longer needed without the stub package. The pre-commit ruff hook moves to v0.17.3 and gains ruff-format. Co-Authored-By: Claude Mythos 5.1 <noreply@anthropic.com>
pattonw
force-pushed
the
chore/ruff-ty-baseline
branch
from
November 4, 2026 00:13
f026a1d to
0cc5d50
Compare
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.
ruff
[tool.ruff.lint]selectsE,F,W,I,UP,B(wasF,W,I001), ignoresE501(the formatter owns line length), allowsE402in tutorials/examples andF401in__init__.py. Two commits:ruff check --fixandruff format, including the semantics-preserving unsafe fixes:zip(..., strict=False)made explicit (19 sites),Optional[X]→X | None(114), printf → f-string.LazyOpas a|union;__sql_type's except clause caughtValueErrorbut the dict lookup raisesKeyError, so it never fired (nowexcept KeyError ... from None);is True/is Falsein tests; the bareexcept:names the two exceptions it handles; six blindpytest.raises(Exception)carry anoqawith the reason (the duplicate-write error is backend-specific).ty
[tool.ty.src] include = ["src", "tests"]. The mypy overrides table andtypes-networkx/types-tomlare gone;types-psycopg2stays because psycopg2 ships no inline types. Of the ten diagnostics that kept the job red:to_world_spacenow declares thendarrayit returns for plain sequences, the PostgreSQL info query assertsfetchone()returned a row,psycopg2.errorsis imported explicitly, and the mypy-eratype: ignorecomments ty does not honour (OME metadata construction, lazy-op narrowing, iohub'sAxisMetaalias) becomety: ignore[<rule>]with reasons. The pre-commit ruff hook moves to v0.17.3 and gainsruff-format.Counters: 0 rules at warn, 11
ty: ignorecomments, 0 excludes.Verified locally
ruff check .,ruff format --check .andty checkall clean;pytest tests134 passed, 29 skipped (PostgreSQL tests need the service).🤖 Generated with Claude Code