{"id":16543357,"url":"https://github.com/s3rius/pre_commit_hooks","last_synced_at":"2025-10-28T15:31:10.807Z","repository":{"id":51202695,"uuid":"368651734","full_name":"s3rius/pre_commit_hooks","owner":"s3rius","description":"Collection of useful pre-commit hooks","archived":false,"fork":false,"pushed_at":"2021-07-14T08:36:38.000Z","size":43,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-05T21:59:03.350Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s3rius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-18T19:57:46.000Z","updated_at":"2023-03-30T21:47:50.000Z","dependencies_parsed_at":"2022-09-04T09:31:12.690Z","dependency_job_id":null,"html_url":"https://github.com/s3rius/pre_commit_hooks","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rius%2Fpre_commit_hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rius%2Fpre_commit_hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rius%2Fpre_commit_hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s3rius%2Fpre_commit_hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s3rius","download_url":"https://codeload.github.com/s3rius/pre_commit_hooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238672178,"owners_count":19511228,"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":[],"created_at":"2024-10-11T19:00:01.917Z","updated_at":"2025-10-28T15:31:05.479Z","avatar_url":"https://github.com/s3rius.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Collection of useful pre-commit hooks.\n\n[![Coveralls](https://img.shields.io/coveralls/github/s3rius/pre_commit_hooks?style=for-the-badge)](https://coveralls.io/github/s3rius/pre_commit_hooks)\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/s3rius/pre_commit_hooks/Pre-commit%20check?style=for-the-badge)\n\nThis repo includes pre-commit-hooks that I couldn't find on the internet.\nIf you find it helpful too, please give a star to this repo.\n\nExisting hooks:\n* [Commit message prefix appender](#commit-message-prefix-appender)\n* [TODOS linked to a Jira ticket](#todos-linked-to-a-jira-ticket)\n\n## Commit message prefix appender\n\n### Abstract\nThis hook appends JIRA task name at the beginning of the commit message just before you commit.\n\nIt detects that current branch is a JIRA ticket name and prepends it's name to the commit message.\n\nTask name detecting is the following:\n* Name starts with at least 2 **uppercase** latin letters;\n* Letters followed by hyphen.\n* hyphen followed by numbers.\n\nE.G:\nIt will detect `TASK-123` or `AJAJ-312`.\n\n### Installation\nAdd to your `.pre-commit-config.yaml`\n\n```yaml\n-   repo: https://github.com/s3rius/pre_commit_hooks\n    hooks:\n    -   id: commit_msg_prefix\n        args:\n            - \"-f={}:\"\n```\n\nAnd install `prepare-commit-msg` hooks like this.\n\n```bash\npre-commit install --hook-type \"prepare-commit-msg\"\n```\n\n### Arguments\nYou can use the following parameters:\n```\n  -f FORMAT, --format FORMAT\n                Commit prefix format. (default: {}:)\n                The \"{}\" will be replaced with current branch name.\n\n  --force       Force prefix addition. (default: False)\n                Add prefix even if it already exists.\n```\n\n## TODOS linked to a Jira ticket\n\n### Abstract\nThis hook won't allow you to commit if you have todo linked to\ncurrently active branch.\n\nTODO is linked if it has the following format:\n```\nTODO TASK-123:\n```\n\nE.G.\nIf you work on a branch JTICKET-123 and you have\ncomment like this somwhere in your codebase:\n```python\na = 3  # TODO JTICKET-123: change to 4\n```\nThis hook will raise an error.\n\n\n### Installation\n\nAdd to your `.pre-commit-config.yaml`\n\n```yaml\n-   repo: https://github.com/s3rius/pre_commit_hooks\n    hooks:\n    -   id: linked_todos\n        args:\n            - FIXME\n            - FOR_TEST\n```\n\n\n### Arguments\nYou can use the following parameters:\n```\npositional arguments:\n  formats          List of different formats for special comments. E.G FIXME. (default: [])\n\noptional arguments:\n  -h, --help       show this help message and exit\n  --disable-todos  Disable todo detection. (default: False)\n```\n\n```\n# note\n\nPositional arguments are provided as is.\n\nargs:\n    - '--disable-todos'\n    - ONE\n    - TWO\n    - THREE\n\nparameters 'ONE', 'TWO' and 'THREE' are positional.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3rius%2Fpre_commit_hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs3rius%2Fpre_commit_hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs3rius%2Fpre_commit_hooks/lists"}