Repository navigation
refactor: define ts and behind_count once, in forge.py (#92) - #94
Merged
Merged
Conversation
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.
Fixes #92.
Both helpers now live in
forge.py, next to the other logic the two forges share (ci_summary,cached_ref,fan_out)._behind_countloses its underscore because both forges import it.github_payloads.tsandgitlab._ts(identical bodies)forge.tsgithub._behind_countandgitlab._behind_count(identical bodies)forge.behind_countforge.tskeeps the useful fact from the GitLab copy's docstring: GitLab's…000Ztimestamps parse because 3.11'sfromisoformataccepts full ISO 8601. That is now a doctest.behind_countalso gets doctests.Callers:
github.py,github_api.py,github_payloads.pyandgitlab.pyeach import fromforgedirectly, not through another module, because mypy strict rejects implicit re-exports.test_gitlab.pyandtest_github_http.pynow import these two helpers fromforge. Their assertions are unchanged.Gates
prek run --all-files: all hooks pass.mypy(strict): clean.pytest: 478 passed (one new doctest block), 100% of lines and branches.radon cc --show-closures -nc: still prints nothing. The lowest maintainability index isgitlab.py, up from 42.9 to 44.1.Merge note: #93 (interrogate) also edits
forge.pyandgitlab.py, in different places. The functions moved here already have docstrings, so they pass #93's 100% gate whichever merges first.Closes #92
🤖 Generated with Claude Code