Title: Functionalize system hook config method · Issue #1605 · usethis-python/usethis-python · GitHub
Open Graph Title: Functionalize system hook config method · Issue #1605 · usethis-python/usethis-python
X Title: Functionalize system hook config method · Issue #1605 · usethis-python/usethis-python
Description: We have a pattern which occurs a lot on the codebase, which I noticed in #1601 PreCommitConfig.from_single_repo( pre_commit_schema.LocalRepo( repo="local", hooks=[ pre_commit_schema.HookDefinition( id="import-linter", name="import-linter...
Open Graph Description: We have a pattern which occurs a lot on the codebase, which I noticed in #1601 PreCommitConfig.from_single_repo( pre_commit_schema.LocalRepo( repo="local", hooks=[ pre_commit_schema.HookDefinition(...
X Description: We have a pattern which occurs a lot on the codebase, which I noticed in #1601 PreCommitConfig.from_single_repo( pre_commit_schema.LocalRepo( repo="local", hooks=[ pre_commit_schema.HookD...
Opengraph URL: https://github.com/usethis-python/usethis-python/issues/1605
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Functionalize system hook config method","articleBody":"We have a pattern which occurs a lot on the codebase, which I noticed in #1601\n\n```\nPreCommitConfig.from_single_repo(\n pre_commit_schema.LocalRepo(\n repo=\"local\",\n hooks=[\n pre_commit_schema.HookDefinition(\n id=\"import-linter\",\n name=\"import-linter\",\n pass_filenames=False,\n entry=f\"uv run {tool_name}\",\n language=get_system_language(),\n require_serial=True,\n always_run=True,\n )\n ],\n ),\n requires_venv=True,\n inform_how_to_use_on_migrate=False,\n )\n```\n\nFor some `tool_name`, and using a backend-dependent logic to choose the `entry=` string. We should probably search for this pattern in the codebase, and introduce a new method on `PreCommitConfig` for generating this pattern from the tool name. This should make things more concise by reducing the cases of if-else branches \nchecking on the backend in the `src/usethis/_tool/impl/spec` layer and elsewhere","author":{"url":"https://github.com/nathanjmcdougall","@type":"Person","name":"nathanjmcdougall"},"datePublished":"2026-03-27T11:54:44.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1605/usethis-python/issues/1605"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b889847f-1c2f-9309-6de8-a03c6209e361 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82A0:C5A49:DB79D4:12D24F8:6A4DEBAA |
| html-safe-nonce | 21410ca6a58fc353310688ec4a1b64c35fbf255a2ebcae742b7f06e80683b947 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkEwOkM1QTQ5OkRCNzlENDoxMkQyNEY4OjZBNERFQkFBIiwidmlzaXRvcl9pZCI6IjM2MjA1MTM3NjEzNjA0NzMwMDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4b12f7420b816ab478f1cd682cb684d36a0f8a225dfd61fedca857f71180e966 |
| hovercard-subject-tag | issue:4151935525 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/usethis-python/usethis-python/1605/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a497a4e948e442351b48f0e9cf8c73ca2b72b413ecd6a228fe54914eec24bbfb/usethis-python/usethis-python/issues/1605 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a497a4e948e442351b48f0e9cf8c73ca2b72b413ecd6a228fe54914eec24bbfb/usethis-python/usethis-python/issues/1605 |
| og:image:alt | We have a pattern which occurs a lot on the codebase, which I noticed in #1601 PreCommitConfig.from_single_repo( pre_commit_schema.LocalRepo( repo="local", hooks=[ pre_commit_schema.HookDefinition(... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nathanjmcdougall |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width