{"id":18909988,"url":"https://github.com/jonasbn/pre-commit-hooks","last_synced_at":"2025-09-21T02:16:52.241Z","repository":{"id":37982609,"uuid":"376119489","full_name":"jonasbn/pre-commit-hooks","owner":"jonasbn","description":"An experiment with Git pre-commit hooks","archived":false,"fork":false,"pushed_at":"2025-06-23T04:30:51.000Z","size":99,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-10T07:29:12.836Z","etag":null,"topics":["git","hacktoberfest","hooks","pre-commit","pre-commit-hooks"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/jonasbn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2021-06-11T19:05:59.000Z","updated_at":"2025-06-23T04:30:54.000Z","dependencies_parsed_at":"2024-12-31T12:48:44.762Z","dependency_job_id":"594d3d3b-a6ea-4957-9c0a-8dcc9d7b4768","html_url":"https://github.com/jonasbn/pre-commit-hooks","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/jonasbn/pre-commit-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fpre-commit-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fpre-commit-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fpre-commit-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fpre-commit-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonasbn","download_url":"https://codeload.github.com/jonasbn/pre-commit-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonasbn%2Fpre-commit-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276183775,"owners_count":25599223,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["git","hacktoberfest","hooks","pre-commit","pre-commit-hooks"],"created_at":"2024-11-08T09:38:54.250Z","updated_at":"2025-09-21T02:16:52.195Z","avatar_url":"https://github.com/jonasbn.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pre-commit-hooks\n\nAn experiment with Git pre-commit hooks\n\n## Hooks\n\n### prohibit-commit-main\n\nThis hook prohibits for committing directly to `main` and `master` branches.\n\n```text\n$ git commit CHANGELOG.md\nCommitting directly to main/master branch is prohibited, use --no-verify / -n if you really insist\n```\n\nThe hook can be bypassed using the command line argument `-n`\n\n```bash\n$ git commit -n -m \"This stuff really need to be commited NOW\"\n```\n\nDo note that [pre-commit], does have a similar hook (`no-commit-to-branch`), which I discovered from the article \"[Chickity-check yo self before you wreck yo self!](https://dev.to/apoclyps/chickity-check-yo-self-before-you-wreck-yo-self-44ib)\" on dev.to.\n\nSo I recommend using [that hook](https://github.com/pre-commit/pre-commit-hooks#no-commit-to-branch) over my own _very basic_ implementation.\n\n### spellcheck\n\nThis hooks checks spelling using `pyspelling`\n\nTo enable add the following to your: `.pre-commit-config.yaml`\n\n```yaml\n-   repo: https://github.com/jonasbn/pre-commit-hooks\n    rev: v0.5.0\n    hooks:\n    -   id: spellcheck\n```\n\nFor configuration please see [the GitHub Action][ghaction].\n\n## DIAGNOSTICS\n\n### exit code: 2\n\nIf you observe this error:\n\n```text\n: not found ... /.cache/pre-commit/repocwpzg79t/spellcheck.sh: 2:\n: not found ... /.cache/pre-commit/repocwpzg79t/spellcheck.sh: 4:\n... /.cache/pre-commit/repocwpzg79t/spellcheck.sh: 7: Syntax error: \"elif\" unexpected (expecting \"then\")\n```\n\nIt is due to the spellcheck shell script being checked out with `CRLF` line-endings.\n\n`dos2unix` can fix this, but it is not a sustainable solution since new it would have to be re-done on every update/reinstallation.\n\n## RESOURCES AND REFERENCES\n\n- [The pre-commit website][pre-commit]\n- [List of supported and available hooks](https://pre-commit.com/hooks.html)\n- [StackOverflow: \"Prevent commits in master branch\"](https://stackoverflow.com/questions/40462111/prevent-commits-in-master-branch)\n- [Git Documentation: \"git-commit - Record changes to the repository\"](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--n)\n\n## LICENSE\n\nPlease see the separate license file\n\n[ghaction]: https://github.com/rojopolis/spellcheck-github-actions\n[pre-commit]: https://pre-commit.com/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fpre-commit-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonasbn%2Fpre-commit-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonasbn%2Fpre-commit-hooks/lists"}