{"id":22878804,"url":"https://github.com/major0/pre-commit-exec","last_synced_at":"2026-05-02T19:35:43.094Z","repository":{"id":74815021,"uuid":"462045235","full_name":"major0/pre-commit-exec","owner":"major0","description":"Execute arbitrary commands/scripts from pre-commit","archived":false,"fork":false,"pushed_at":"2022-02-22T00:07:58.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T20:39:55.660Z","etag":null,"topics":["git","pre-commit-hook","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/major0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-21T21:58:54.000Z","updated_at":"2022-03-09T17:35:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"88700a0a-7c99-4678-9f0e-23e791a61311","html_url":"https://github.com/major0/pre-commit-exec","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0%2Fpre-commit-exec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0%2Fpre-commit-exec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0%2Fpre-commit-exec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/major0%2Fpre-commit-exec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/major0","download_url":"https://codeload.github.com/major0/pre-commit-exec/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246482822,"owners_count":20784786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","pre-commit-hook","python"],"created_at":"2024-12-13T16:31:42.480Z","updated_at":"2026-05-02T19:35:43.051Z","avatar_url":"https://github.com/major0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pre-commit-exec\n===============\n\nThis is a [pre-commit][] plugin which allows the execution of arbitrary\ncommands/scripts.  This plugin grants generic access to system commands and\nrepository scripts without the need to create a new repository. This is\nparticularly useful when a single check requires the combination of multiple\nsteps.  I.e. a [CI/CD][] workflow pattern.\n\nFor example, in building a static website and testing the [HTML] links in the\ngenerated website we can launch script handler, such as:\n```\n- repo: https://github.com/major0/pre-commit-exec\n  rev: v0.1.2\n  hooks:\n    - id: command\n      alias: hugo-build\n      always_run: true\n      name: Hugo Build\n      args: [\"hugo\", \"--cleanDestinationDir\", \"--noTimes\", \"--destination\", \".build\", \"--baseUrl\", \"file:///.build/\"]\n- repo: https://github.com/major0/pre-commit-exec\n  rev: v0.1.2\n  hooks:\n    - id: command\n      alias: link-check\n      always_run: true\n      name: Check site links\n      args: [\"sh\", \"scripts/link-check.sh\"]\n- repo: https://github.com/major0/pre-commit-exec\n  rev: v0.1.2\n  hooks:\n    - id: command\n      alias: link-check-all\n      stages: [manual]\n      name: Check all links\n      args: [\"sh\", \"scripts/link-check.sh\", \"--all\"]\n```\n\nThis plugin supports 2 hooks: `command` and `shell`.  Both are handled by\n[Python][]'s `subprocess.run()` interface.  The only difference between them is\nthat the `shell` hook grants access to various shell features.\n\nFrom \u003chttps://docs.python.org/3/library/subprocess.html\u003e:\n\n\u003e  This can be useful if you are using Python primarily for the enhanced\n\u003e  control flow it offers over most system shells and still want convenient\n\u003e  access to other shell features such as shell pipes, filename wildcards,\n\u003e  environment variable expansion, and expansion of ~ to a user’s home\n\u003e  directory. \n\n[//]: # (References)\n\n[pre-commit]: https://pre-commit.com/\n[git]: https://gitscm.org/\n[HTML]: https://en.wikipedia.org/wiki/HTML\n[subprocess]: https://docs.python.org/3/library/subprocess.html\n[globbing]: https://en.wikipedia.org/wiki/Glob_(programming)\n[Python]: https://python.org/\n[CI/CD]: https://en.wikipedia.org/wiki/CI/CD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor0%2Fpre-commit-exec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmajor0%2Fpre-commit-exec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmajor0%2Fpre-commit-exec/lists"}