{"id":24513633,"url":"https://github.com/dbhagen/blocking-comment","last_synced_at":"2025-03-15T10:22:12.374Z","repository":{"id":226672919,"uuid":"769354584","full_name":"dbhagen/blocking-comment","owner":"dbhagen","description":"Pre-commit hook to check for blocking comments before committing.","archived":false,"fork":false,"pushed_at":"2024-03-09T16:27:15.000Z","size":22,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T00:55:30.175Z","etag":null,"topics":["comments","hooks","pre-commit","pre-commit-hook","pre-commit-hooks","prevent-commit","prevention","safety"],"latest_commit_sha":null,"homepage":"https://github.com/dbhagen/pre-commit-blocking-comment","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/dbhagen.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}},"created_at":"2024-03-08T21:52:33.000Z","updated_at":"2024-03-12T14:28:22.000Z","dependencies_parsed_at":"2024-03-09T17:42:07.939Z","dependency_job_id":null,"html_url":"https://github.com/dbhagen/blocking-comment","commit_stats":null,"previous_names":["dbhagen/pre-commit-blocking-comment","dbhagen/blocking-comment"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbhagen%2Fblocking-comment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbhagen%2Fblocking-comment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbhagen%2Fblocking-comment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbhagen%2Fblocking-comment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbhagen","download_url":"https://codeload.github.com/dbhagen/blocking-comment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243714790,"owners_count":20335811,"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":["comments","hooks","pre-commit","pre-commit-hook","pre-commit-hooks","prevent-commit","prevention","safety"],"created_at":"2025-01-22T00:55:45.983Z","updated_at":"2025-03-15T10:22:12.352Z","avatar_url":"https://github.com/dbhagen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pre-Commit Blocking-Comment Hook\n\nPre-commit hook to check for blocking comments before committing.\n\n## Overview\n\nThis [pre-commit](https://pre-commit.com) hook is designed to help you avoid accidentally committing code with blocking comments that indicate a task or issue that needs to be addressed before the commit can be finalized. It scans files for specific comment patterns, looking for comments containing either `blocking-comment` or `block-commit`.\n\n## Use Case\n\nThis hook is particularly useful for placing reminders in your codebase for temporary local changes that shouldn't be pushed or committed until the associated task or issue is resolved. By using a blocking comment, you ensure that these changes won't impact CI/CD pipelines or other automated processes until the comment is removed.\n\nFor example, you might use this hook to mark areas of code that need additional testing, documentation updates, or further review before being included in the final commit.\n\n## Installation\n\nAdd the following hook to your `.pre-commit-config.yaml`\n\n```yaml\nrepos:\n  - repo: https://github.com/dbhagen/blocking-comment\n    rev: v1.0.5\n    hooks:\n      - id: blocking-comment\n```\n\n## Usage\n\nThe [pre-commit](https://pre-commit.com) hook will automatically run before each commit. If any blocking comments are found, the commit will be blocked, and information about the offending comments will be displayed.\n\n## Comment type supports\n\nThe following comment types are supported:\n```python\n# blocking-comment: Don't commit\n# block-commit\n```\n```java\n// blocking-comment: Don't commit\n// block-commit\n/* blocking-comment: Don't commit */\n/* block-commit */\n```\n```HTML\n\u003c!-- blocking-comment: Don't commit --\u003e\n\u003c!-- block-commit --\u003e\n```\n## Example\n\nWithin a `git` directory with `pre-commit` configured as described above, modify a file to have the contents `# block-commit` anywhere in the file. Then try to commit your files:\n\n```bash\n$ git add your-file.py\n$ git commit -m \"Your commit message\"\n```\n\nYou should receive the following error:\n```bash\nPrevent on Blocking Comments.............................................Failed\n- hook id: blocking-comment\n- exit code: 1\n\nBlocking comment found in file: your-file.py\n  Line 1, position 1\n  Line: # block-commit\n```\n## license\nThis pre-commit hook is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n\nFeel free to customize or expand this text further to better suit your needs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbhagen%2Fblocking-comment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbhagen%2Fblocking-comment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbhagen%2Fblocking-comment/lists"}