Uh oh!
There was an error while loading. Please reload this page.
Apply ruff formatting and safe lint fixes - #1061
Conversation
…igial-test-fields [v5.0] Remove vestigial experimental fields from test fixture
Ran `ruff format` and `ruff check --fix` (safe fixes only, line-length 99) over all Python files in src/ and tests/. Resolved conflicts with the project's flake8 configuration: - Disabled RUF100 during the fix so noqa comments flake8 relies on (D-codes, E501, W505) are preserved. - Hand-wrapped 8 f-strings that exceeded 99 chars after .format() -> f-string conversion. - Added E203 to the flake8 ignore list (standard ruff/black slice-spacing exception). Fixed two autofixes that would have broken the test suite: - Restored the load-bearing import order in tests/utils/fakes/__init__.py (marked # isort: skip_file) to avoid a circular import. - Restored the pytest fixture import in tests/serialization/test_scorers.py (marked # noqa: F401). flake8 is clean and all 1237 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| properties = Optional( | ||
| List( | ||
| Union( | ||
| [ | ||
| LinkOrElse(GEMDPropertyTemplate), | ||
| SpecifiedMixedList( | ||
| [LinkOrElse(GEMDPropertyTemplate), Optional(Object(BaseBounds))] | ||
| ), | ||
| ] | ||
| ) | ||
| ), | ||
| "properties", | ||
| override=True, | ||
| ) |
There was a problem hiding this comment.
Oof. I hate this. However, it's more an expression of how messy the definition of the serde stuff is generally, laid bare by the complication of the type itself. So not sure there's anything to be done. Ugh.
There was a problem hiding this comment.
I created an alias for LinkOrElse(GEMDPropertyTemplate) and swapped the Union to a |. I think it's more legible.
There was a problem hiding this comment.
I don't think the change you described made it into the commit? At least, I don't see it above.
| | LinkByUID | ||
| | Sequence[PropertyTemplate | LinkByUID | BaseBounds | None] | ||
| ] | ||
| | None = None, |
There was a problem hiding this comment.
I continue to think multi-line type definitions in the middle of a function definition are the work of the devil. But I'm not sure a super long line is much better...
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Follow-up to the ruff-formatting pass, addressing Austin's review feedback and applying the same fixes to unflagged instances of each concern type. - Add [tool.ruff] config: skip-magic-trailing-comma (collapses single-line collections instead of exploding them) with isort.split-on-trailing-comma disabled for compatibility. - Convert .format() calls on string literals to f-strings. - Drop orphaned `# pragma: no cover` comments left after `pass` removal. - Refactor split-operand/wrapped asserts to keep operands together (extract locals, loop over cases, lambda accessors) and move comments that forced line wraps above their expressions. - gemtables/variables.py: extract the repeated ternary into a module-level `_build_attribute_constraints` helper and hoist the duplicated `_AttributeType`/`_ObjectType`/`_ConstraintType` aliases to module scope. - Restore correct (separate) LinkOrElse instances in the template property definitions; shared Property descriptors break serialization-path assignment. - validate_type: raise ValueError instead of bare Exception. - Cover PvA __iter__ explicitly after switching next(iter(...)) reads to []. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
anoto-moniz
commented
Sep 2, 2026
@kroenlein With the exception of #1061 (comment), this looks great! Once you get that squared away, I'll give you a stamp, and update my workflow to use |
The only purpose of the PR is running all package lines through ruff so that future formatting issues do not distract from code changes.
PR Type:
Adherence to team decisions