René's URL Explorer Experiment


Title: SKIP skips invocation by alias but doesn't skip "Installing environment" · Issue #2478 · pre-commit/pre-commit · GitHub

Open Graph Title: SKIP skips invocation by alias but doesn't skip "Installing environment" · Issue #2478 · pre-commit/pre-commit

X Title: SKIP skips invocation by alias but doesn't skip "Installing environment" · Issue #2478 · pre-commit/pre-commit

Description: search tried in the issue tracker SKIP alias describe your issue When I run SKIP=pylint-alias2 git commit the hook aliased as pylint-alias2 is properly skipped, however, its environment is still initialized. I would expect that it also s...

Open Graph Description: search tried in the issue tracker SKIP alias describe your issue When I run SKIP=pylint-alias2 git commit the hook aliased as pylint-alias2 is properly skipped, however, its environment is still in...

X Description: search tried in the issue tracker SKIP alias describe your issue When I run SKIP=pylint-alias2 git commit the hook aliased as pylint-alias2 is properly skipped, however, its environment is still in...

Opengraph URL: https://github.com/pre-commit/pre-commit/issues/2478

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SKIP skips invocation by alias but doesn't skip \"Installing environment\"","articleBody":"### search tried in the issue tracker\r\n\r\nSKIP alias\r\n\r\n### describe your issue\r\n\r\nWhen I run \r\n\r\n```sh\r\nSKIP=pylint-alias2 git commit\r\n```\r\n\r\nthe hook aliased as `pylint-alias2` is properly skipped, however, its environment is still initialized. I would expect that it also skips the lengthy initialization of the environment.\r\n\r\nIndeed, running a single hook ([run.py#153](https://github.com/pre-commit/pre-commit/blob/49f95b9ef391639d09136666be375d99a3dccd04/pre_commit/commands/run.py#153)) checks against `hook.id` and `hook.alias`, however `install_hook_envs` is invoked with only filtering against `hook.id` ([run.py#423](https://github.com/pre-commit/pre-commit/blob/49f95b9ef391639d09136666be375d99a3dccd04/pre_commit/commands/run.py)\r\n\r\nIs this inconsistency deliberate? I couldn't find a use case for it. This quick and dirty patch works for us:\r\n\r\n```diff\r\n-        to_install = [hook for hook in hooks if hook.id not in skips]\r\n+        to_install = [hook for hook in hooks if hook.id not in skips and hook.alias not in skips]\r\n```\r\n\r\nIn our use case Initialization is not needed for everyone (monorepo where some non-python devs also do non-python work) and also very expensive unfortunately (6minutes currently to install already cached pip packages)\r\n\r\n(An even better solution would be if initialization wouldn't happen at all if the hook run would we skipped in general (because of `SKIP` variable or because there is no files changed, however, that would be a but bigger patch I suppose))\r\n\r\n### pre-commit --version\r\n\r\npre-commit \r\n\r\n### .pre-commit-config.yaml\r\n\r\n```yaml\r\nrepos:\r\n  - repo: https://github.com/PyCQA/pylint\r\n    rev: v2.14.5\r\n    hooks:\r\n      - name: pylint-alias1\r\n        alias: pylint-alias1\r\n        id: pylint\r\n        additional_dependencies:\r\n          - arrow\r\n      - name: pylint-alias2\r\n        alias: pylint-alias2\r\n        id: pylint\r\n        additional_dependencies:\r\n          - hdfs\r\n```\r\n\r\n\r\n### ~/.cache/pre-commit/pre-commit.log (if present)\r\n\r\n_No response_","author":{"url":"https://github.com/kmARC","@type":"Person","name":"kmARC"},"datePublished":"2022-08-10T13:49:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/2478/pre-commit/issues/2478"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5de1ba15-30ff-1ec3-5c96-3d65a763a5d0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE53A:19CFB6:C1F216:1028813:6A52C300
html-safe-noncea6ca7699837c752f7fdb0bf20ba154e532fa59966c3dccaafdce3c6a03538838
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTNBOjE5Q0ZCNjpDMUYyMTY6MTAyODgxMzo2QTUyQzMwMCIsInZpc2l0b3JfaWQiOiIxNjQ0OTI3NTIzODk4NDk4NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacc793bfb05002d3873c2f278462e9d473d0fa6a2dc117dfa20a68c5c1eb409b1b
hovercard-subject-tagissue:1334660855
github-keyboard-shortcutsrepository,issues,commits,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pre-commit/pre-commit/2478/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5391453a096e4010d723bb09bfaf5735d5bc7136118d77654b52b8bfc31bb9be/pre-commit/pre-commit/issues/2478
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5391453a096e4010d723bb09bfaf5735d5bc7136118d77654b52b8bfc31bb9be/pre-commit/pre-commit/issues/2478
og:image:altsearch tried in the issue tracker SKIP alias describe your issue When I run SKIP=pylint-alias2 git commit the hook aliased as pylint-alias2 is properly skipped, however, its environment is still in...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamekmARC
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/pre-commit/pre-commit git https://github.com/pre-commit/pre-commit.git
octolytics-dimension-user_id6943086
octolytics-dimension-user_loginpre-commit
octolytics-dimension-repository_id17689377
octolytics-dimension-repository_nwopre-commit/pre-commit
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id17689377
octolytics-dimension-repository_network_root_nwopre-commit/pre-commit
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/pre-commit/pre-commit/issues/2478#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpre-commit%2Fpre-commit%2Fissues%2F2478
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/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/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/enterprise/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%2Fpre-commit%2Fpre-commit%2Fissues%2F2478
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=pre-commit%2Fpre-commit
Reloadhttps://github.com/pre-commit/pre-commit/issues/2478
Reloadhttps://github.com/pre-commit/pre-commit/issues/2478
Reloadhttps://github.com/pre-commit/pre-commit/issues/2478
Please reload this pagehttps://github.com/pre-commit/pre-commit/issues/2478
pre-commit https://github.com/pre-commit
pre-commithttps://github.com/pre-commit/pre-commit
Please reload this pagehttps://github.com/pre-commit/pre-commit/issues/2478
Notifications https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit
Fork 984 https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit
Star 15.4k https://github.com/login?return_to=%2Fpre-commit%2Fpre-commit
Code https://github.com/pre-commit/pre-commit
Issues 22 https://github.com/pre-commit/pre-commit/issues
Pull requests 12 https://github.com/pre-commit/pre-commit/pulls
Actions https://github.com/pre-commit/pre-commit/actions
Security and quality 0 https://github.com/pre-commit/pre-commit/security
Insights https://github.com/pre-commit/pre-commit/pulse
Code https://github.com/pre-commit/pre-commit
Issues https://github.com/pre-commit/pre-commit/issues
Pull requests https://github.com/pre-commit/pre-commit/pulls
Actions https://github.com/pre-commit/pre-commit/actions
Security and quality https://github.com/pre-commit/pre-commit/security
Insights https://github.com/pre-commit/pre-commit/pulse
#2480https://github.com/pre-commit/pre-commit/pull/2480
SKIP skips invocation by alias but doesn't skip "Installing environment"https://github.com/pre-commit/pre-commit/issues/2478#top
#2480https://github.com/pre-commit/pre-commit/pull/2480
https://github.com/kmARC
kmARChttps://github.com/kmARC
on Aug 10, 2022https://github.com/pre-commit/pre-commit/issues/2478#issue-1334660855
run.py#153https://github.com/pre-commit/pre-commit/blob/49f95b9ef391639d09136666be375d99a3dccd04/pre_commit/commands/run.py#153
run.py#423https://github.com/pre-commit/pre-commit/blob/49f95b9ef391639d09136666be375d99a3dccd04/pre_commit/commands/run.py
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.