Repository navigation
CI: check imports with customs, and break the connection/copy cycle - #20
Merged
Merged
Conversation
`postgres.connection` and `postgres.copy` imported each other: `connection` for `CopyIn`/`CopyOut`, `copy` for `_ConnCell` and the helpers that run commands and raise errors on it. Those (`_ConnCell`, `_trim`, `_affected_rows`, `_result_error`, `_record`, `_raise_error`, `_open_conn`, `_raise_result`, `_closed_error`, `drain_results`, `drain_results_quietly`, `discard_copy_quietly`) move unchanged into `postgres/_cell.mojo`, which both import; nothing public changes. Checked locally: `pixi run unit`, `server`, `lint` and `examples` pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds a
customsjob (https://github.com/ouromo/customs, v0.2.0) and makes it part of thecigate. It checks that no modules import each other in a cycle, and that each name is imported from the module that defines it, not one that re-exports it (a package's__init__.mojomay).postgres.connectionandpostgres.copyimported each other:connectionforCopyIn/CopyOut,copyfor_ConnCelland the helpers that run commands and raise errors on it. Those (_ConnCell,_trim,_affected_rows,_result_error,_record,_raise_error,_open_conn,_raise_result,_closed_error,drain_results,drain_results_quietly,discard_copy_quietly) move unchanged intopostgres/_cell.mojo, which both import; nothing public changes.Checked locally:
pixi run unit,server,lintandexamplespass.🤖 Generated with Claude Code