{"id":32146895,"url":"https://github.com/csjones/lefthook-plugin","last_synced_at":"2026-01-27T10:18:34.063Z","repository":{"id":193957088,"uuid":"689805386","full_name":"csjones/lefthook-plugin","owner":"csjones","description":"Fast and powerful Git hooks manager for Swift packages.","archived":false,"fork":false,"pushed_at":"2026-01-13T20:29:35.000Z","size":74,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-16T21:38:47.380Z","etag":null,"topics":["code-quality","git","git-hooks","hooks","hooks-manager","pre-commit","pre-push","swift","swift-package-manager","swift-plugin"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/csjones.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-09-11T00:03:05.000Z","updated_at":"2026-01-13T20:29:34.000Z","dependencies_parsed_at":"2023-09-11T01:26:52.944Z","dependency_job_id":"4b1ff006-362d-4da3-a68c-4d8adc3ca219","html_url":"https://github.com/csjones/lefthook-plugin","commit_stats":null,"previous_names":["csjones/lefthook-plugin"],"tags_count":110,"template":false,"template_full_name":"21-DOT-DEV/swift-plugin-template","purl":"pkg:github/csjones/lefthook-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csjones%2Flefthook-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csjones%2Flefthook-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csjones%2Flefthook-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csjones%2Flefthook-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csjones","download_url":"https://codeload.github.com/csjones/lefthook-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csjones%2Flefthook-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28811606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["code-quality","git","git-hooks","hooks","hooks-manager","pre-commit","pre-push","swift","swift-package-manager","swift-plugin"],"created_at":"2025-10-21T08:32:28.423Z","updated_at":"2026-01-27T10:18:34.058Z","avatar_url":"https://github.com/csjones.png","language":"Swift","readme":"# lefthook-plugin\n\nA Swift Package that integrates [lefthook](https://github.com/evilmartians/lefthook), a fast and powerful Git hooks manager, into the Swift ecosystem. \n\n## Features\n\n- **Fast Execution**: Written in Go, lefthook can run commands in parallel.\n- **Powerful Configuration**: Control execution and the files you pass to your commands.\n- **Swift Integration**: Seamlessly integrates with Swift projects through the Swift Package Manager.\n- **Mint support**: Run lefthook using [mint](https://github.com/yonaskolb/Mint), a package manager for Swift CLI tools. \n\n## Installation\n\n### Using Swift Package Manager plugin \n\nTo utilize the `lefthook-plugin`, include it in the target specification of your Swift Package:\n\n```swift\n// swift-tools-version: 5.6\nimport PackageDescription\n\nlet package = Package(\n    name: \"YourPackageName\",\n    dependencies: [\n        .package(url: \"https://github.com/csjones/lefthook-plugin.git\", exact: \"2.0.16\"),\n    ],\n    targets: [\n        .executableTarget(name: \"YourTargetName\")\n    ]\n)\n```\n\nThis configuration ensures that SPM invokes the plugin, thereby integrating lefthook's capabilities into your Swift project.\n\n### Using [mint](https://github.com/yonaskolb/Mint)\n\n```\n$ mint install csjones/lefthook-plugin\n```\n\n## Commands\n\nAfter `lefthook` is [installed](#installation) in your Swift project, it's time to run it. \n\n### Using Swift Package Manager plugin \n\nInvoke the plugin directly using the `swift package plugin` CLI:\n\n```bash\nswift package lefthook --help\n```\n\nRun `lefthook install` to initialize a lefthook.yml config and/or synchronize `.git/hooks/` with your configuration.\n\n```bash\nswift package --disable-sandbox lefthook install\n```\n\n\u003e [!IMPORTANT]  \n\u003e The lefthook plugin necessitates the `--disable-sandbox` flag with the Swift Package Manager due to its requirement for local document access to read files.\n\nTo execute the lefthook plugin within your package repository:\n\n```bash\nswift package --disable-sandbox lefthook run pre-commit\n```\n\n\u003e [!NOTE]\n\u003e For a detailed understanding of lefthook's commands and their usage, refer to [lefthook's official usage documentation](https://github.com/evilmartians/lefthook/blob/master/docs/usage.md).\n\n### Using `mint`\n\nAfter running `mint install csjones/lefthook-plugin` to install the CLI tool, anytime you want to interact with `lefthook`, all you have to do is run `mint run csjones/lefthook-plugin \u003ccommand\u003e`. Example: `mint run csjones/lefthook-plugin --help`. \n\n## Configuration\n\nBelow is a sample configuration for lefthook:\n\n```yml\npre-push:\n  commands:\n    1_test:\n      run: swift test\n\npre-commit:\n  commands:\n    1_swiftformat:\n      glob: \"*.{swift}\"\n      run: swift run swiftformat --config .swiftformat {all_files}\n    2_swiftlint:\n      glob: \"*.{swift}\"\n      run: swift run swiftlint --autocorrect --strict --no-cache\n    3_git:\n      run: git add .\n```\n\n\u003e [!TIP]\n\u003e For a comprehensive understanding and more advanced configurations, refer to [lefthook's official configuration documentation](https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md).\n\n## Community and Support\n\nIf you encounter any issues or have questions regarding the `lefthook-plugin`, please open an issue on GitHub. Contributions, suggestions, and feedback are always welcome!\n\n## Acknowledgments\n\nSpecial thanks to the original [lefthook](https://github.com/evilmartians/lefthook) project and its contributors for creating a powerful Git hooks manager.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsjones%2Flefthook-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsjones%2Flefthook-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsjones%2Flefthook-plugin/lists"}