René's URL Explorer Experiment


Title: Use pipeweld to insert pre-commit hooks by Copilot · Pull Request #1595 · usethis-python/usethis-python · GitHub

Open Graph Title: Use pipeweld to insert pre-commit hooks by Copilot · Pull Request #1595 · usethis-python/usethis-python

X Title: Use pipeweld to insert pre-commit hooks by Copilot · Pull Request #1595 · usethis-python/usethis-python

Description: Hook insertion in add_repo() used hand-rolled precedent/successor logic against a static _HOOK_ORDER list. This replaces it with pipeweld's Adder, which models the same ordering constraints as a series-parallel graph — laying groundwork for repo-aware insertion and prek priority support. Changes func.py — Adder: Added force_linear setting that post-processes the solution to flatten any Parallel nodes into a deterministic linear Series. Added _extract_ordered_steps() and _linearize_component() helpers internal to the pipeweld layer. func.py — get_predecessor(): Added a public function that recursively walks the full component tree (str, Series, Parallel, DepGroup, nested structures) to find the step that immediately precedes a given step. Returns None if the step is first, raises ValueError if not found. hooks.py — add_repo(): Build a Series pipeline from existing hook IDs, derive prerequisites/postrequisites sets from _HOOK_ORDER, delegate insertion positioning to Adder.add() with force_linear=True, and use get_predecessor() to extract the predecessor from the solution. test_func.py: Unit tests for _extract_ordered_steps, _linearize_component, Adder with force_linear=True, and get_predecessor() with comprehensive coverage across all component types and nesting depths (32 new tests) test_hooks.py: Integration tests exercising pipeweld-based insertion (prerequisite present, postrequisite only, mixed non-dependent/postrequisite) Before/After # Before: manual list slicing precedents = _HOOK_ORDER[:hook_idx] successors = _HOOK_ORDER[hook_idx + 1:] existing_precedents = [h for h in existing_hooks if h in precedents] # ... 15 lines of if/elif/else to find last_precedent # After: pipeweld solver adder = Adder( pipeline=series(*existing_hooks), step=hook_config.id, prerequisites=set(_HOOK_ORDER[:hook_idx]), postrequisites=set(_HOOK_ORDER[hook_idx + 1:]), force_linear=True, ) result = adder.add() predecessor = get_predecessor(result.solution, hook_config.id) All existing tests pass unchanged — behavioral compatibility is preserved for current hook orderings. ⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

Open Graph Description: Hook insertion in add_repo() used hand-rolled precedent/successor logic against a static _HOOK_ORDER list. This replaces it with pipeweld's Adder, which models the same ordering constraints as ...

X Description: Hook insertion in add_repo() used hand-rolled precedent/successor logic against a static _HOOK_ORDER list. This replaces it with pipeweld's Adder, which models the same ordering constraints...

Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1595

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:3fb5b6d7-e828-b703-2112-e84d607c5b93
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idECF2:2B367:1C16AE:263538:6A4D29D8
html-safe-nonce69a5edd2ab494a295c893852cc8779b9d6126a62e28f8f153df7c0a53745b813
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0YyOjJCMzY3OjFDMTZBRToyNjM1Mzg6NkE0RDI5RDgiLCJ2aXNpdG9yX2lkIjoiNDM4NzkwMjY5Nzc4MjQ1NDc0NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac12e7453b45a5a92a61555b26ac8cdb577596e5c5f57c9aa122c8b9eeeab4a8c2
hovercard-subject-tagpull_request:3456136614
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/usethis-python/usethis-python/pull/1595/files
twitter:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
og:image:altHook insertion in add_repo() used hand-rolled precedent/successor logic against a static _HOOK_ORDER list. This replaces it with pipeweld's Adder, which models the same ordering constraints as ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git
octolytics-dimension-user_id216362695
octolytics-dimension-user_loginusethis-python
octolytics-dimension-repository_id842189705
octolytics-dimension-repository_nwousethis-python/usethis-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id842189705
octolytics-dimension-repository_network_root_nwousethis-python/usethis-python
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release93f17a978ee60bc4668e1d7b90e6bd2d622261fd
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/usethis-python/usethis-python/pull/1595/changes#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fusethis-python%2Fusethis-python%2Fpull%2F1595%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fusethis-python%2Fusethis-python%2Fpull%2F1595%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=usethis-python%2Fusethis-python
Reloadhttps://github.com/usethis-python/usethis-python/pull/1595/changes
Reloadhttps://github.com/usethis-python/usethis-python/pull/1595/changes
Reloadhttps://github.com/usethis-python/usethis-python/pull/1595/changes
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1595/changes
usethis-python https://github.com/usethis-python
usethis-pythonhttps://github.com/usethis-python/usethis-python
Notifications https://github.com/login?return_to=%2Fusethis-python%2Fusethis-python
Fork 5 https://github.com/login?return_to=%2Fusethis-python%2Fusethis-python
Star 19 https://github.com/login?return_to=%2Fusethis-python%2Fusethis-python
Code https://github.com/usethis-python/usethis-python
Issues 163 https://github.com/usethis-python/usethis-python/issues
Pull requests 4 https://github.com/usethis-python/usethis-python/pulls
Actions https://github.com/usethis-python/usethis-python/actions
Security and quality 0 https://github.com/usethis-python/usethis-python/security
Insights https://github.com/usethis-python/usethis-python/pulse
Code https://github.com/usethis-python/usethis-python
Issues https://github.com/usethis-python/usethis-python/issues
Pull requests https://github.com/usethis-python/usethis-python/pulls
Actions https://github.com/usethis-python/usethis-python/actions
Security and quality https://github.com/usethis-python/usethis-python/security
Insights https://github.com/usethis-python/usethis-python/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fusethis-python%2Fusethis-python%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fusethis-python%2Fusethis-python%2Fissues%2Fnew%2Fchoose
nathanjmcdougallhttps://github.com/nathanjmcdougall
mainhttps://github.com/usethis-python/usethis-python/tree/main
copilot/better-respect-pre-commit-reposhttps://github.com/usethis-python/usethis-python/tree/copilot/better-respect-pre-commit-repos
Conversation 9 https://github.com/usethis-python/usethis-python/pull/1595
Commits 11 https://github.com/usethis-python/usethis-python/pull/1595/commits
Checks 20 https://github.com/usethis-python/usethis-python/pull/1595/checks
Files changed https://github.com/usethis-python/usethis-python/pull/1595/files
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1595/changes
Use pipeweld to insert pre-commit hooks https://github.com/usethis-python/usethis-python/pull/1595/changes#top
Show all changes 11 commits https://github.com/usethis-python/usethis-python/pull/1595/files
6ea5224 Initial plan Copilot Mar 27, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/6ea52244a1c155c13b74531b1fc9c4c122d3afce
92bf92a Use pipeweld Adder to determine pre-commit hook insertion position Copilot Mar 27, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/92bf92ae0462abdfdb115076a965a75f2a5c4b9e
8e9c262 Fix unreachable code warning and improve docstrings Copilot Mar 27, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/8e9c262b4490f5bf2e853321f3629973e0dc2278
23100f8 Merge branch 'main' into copilot/better-respect-pre-commit-repos nathanjmcdougall Mar 28, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/23100f88d7f15da1fc8e3d50cab8502054f55107
cb3d129 Move DepGroup import to TYPE_CHECKING block (TC001) Copilot Mar 28, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/cb3d1292f575bfb110a7c7a88e12499ebe29011f
c643ccd Move linearization logic from hooks.py into pipeweld Adder via force_… Copilot Mar 29, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/c643ccd26a899bef90213c32fe1d65dc5fb3ea8c
12fdf66 Add clarifying comment for sort_key fallback in _linearize_component Copilot Mar 29, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/12fdf66deac0dae23e5db0cda8e61de5c5717375
fb5d9c0 Move predecessor extraction logic into pipeweld layer as get_predeces… Copilot Apr 1, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/fb5d9c0a3b114481758c6debfa98feb776ab3075
0a44c47 Merge branch 'main' into copilot/better-respect-pre-commit-repos nathanjmcdougall Apr 1, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/0a44c473c00818a6e5c994effeac3d9333ebe081
f464c4b Merge branch 'main' into copilot/better-respect-pre-commit-repos nathanjmcdougall Apr 1, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/f464c4b3c178d9a412782dc1ac1ac90a008c8529
c734d83 Comply with hooks nathanjmcdougall Apr 1, 2026 https://github.com/usethis-python/usethis-python/pull/1595/commits/c734d83d069564c5c285e5767f270464631b0365
Clear filters https://github.com/usethis-python/usethis-python/pull/1595/files
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1595/changes
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1595/changes
AGENTS.md https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
functions.txt https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-6705114142ee332330bd7f0684141070919dbb082ecebdd765866a2a2d488f46
hooks.py https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-264ce1235d8bbe19a3face2b7ac6484c043e8b206204f8711b3918056e8afeba
func.py https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a9fec0a37f88a7dce6d62998d4adfa8161560ae5c83f8e95c15e15c4b3b5c2a3
test_hooks.py https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-5ab09fc2895bd8dd843846dbc43925cc4ba9a24cebe5b270970a7fd8e5e3e3d0
test_func.py https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-1df28092c00a992b5fdfb1894c7104ad44818f3ebc8e9e5d387254cf013bf903
AGENTS.mdhttps://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
View file https://github.com/usethis-python/usethis-python/blob/c734d83d069564c5c285e5767f270464631b0365/AGENTS.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1595/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9
docs/functions.txthttps://github.com/usethis-python/usethis-python/pull/1595/changes#diff-6705114142ee332330bd7f0684141070919dbb082ecebdd765866a2a2d488f46
View file https://github.com/usethis-python/usethis-python/blob/c734d83d069564c5c285e5767f270464631b0365/docs/functions.txt
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1595/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-6705114142ee332330bd7f0684141070919dbb082ecebdd765866a2a2d488f46
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-6705114142ee332330bd7f0684141070919dbb082ecebdd765866a2a2d488f46
src/usethis/_integrations/pre_commit/hooks.pyhttps://github.com/usethis-python/usethis-python/pull/1595/changes#diff-264ce1235d8bbe19a3face2b7ac6484c043e8b206204f8711b3918056e8afeba
View file https://github.com/usethis-python/usethis-python/blob/c734d83d069564c5c285e5767f270464631b0365/src/usethis/_integrations/pre_commit/hooks.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1595/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-264ce1235d8bbe19a3face2b7ac6484c043e8b206204f8711b3918056e8afeba
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-264ce1235d8bbe19a3face2b7ac6484c043e8b206204f8711b3918056e8afeba
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-264ce1235d8bbe19a3face2b7ac6484c043e8b206204f8711b3918056e8afeba
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-264ce1235d8bbe19a3face2b7ac6484c043e8b206204f8711b3918056e8afeba
src/usethis/_pipeweld/func.pyhttps://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a9fec0a37f88a7dce6d62998d4adfa8161560ae5c83f8e95c15e15c4b3b5c2a3
View file https://github.com/usethis-python/usethis-python/blob/c734d83d069564c5c285e5767f270464631b0365/src/usethis/_pipeweld/func.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1595/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a9fec0a37f88a7dce6d62998d4adfa8161560ae5c83f8e95c15e15c4b3b5c2a3
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a9fec0a37f88a7dce6d62998d4adfa8161560ae5c83f8e95c15e15c4b3b5c2a3
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a9fec0a37f88a7dce6d62998d4adfa8161560ae5c83f8e95c15e15c4b3b5c2a3
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-a9fec0a37f88a7dce6d62998d4adfa8161560ae5c83f8e95c15e15c4b3b5c2a3
tests/usethis/_integrations/pre_commit/test_hooks.pyhttps://github.com/usethis-python/usethis-python/pull/1595/changes#diff-5ab09fc2895bd8dd843846dbc43925cc4ba9a24cebe5b270970a7fd8e5e3e3d0
View file https://github.com/usethis-python/usethis-python/blob/c734d83d069564c5c285e5767f270464631b0365/tests/usethis/_integrations/pre_commit/test_hooks.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/usethis-python/usethis-python/pull/1595/{{ revealButtonHref }}
https://github.com/usethis-python/usethis-python/pull/1595/changes#diff-5ab09fc2895bd8dd843846dbc43925cc4ba9a24cebe5b270970a7fd8e5e3e3d0
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1595/changes
Please reload this pagehttps://github.com/usethis-python/usethis-python/pull/1595/changes
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.