{"id":19402192,"url":"https://github.com/robertdebock/pre-commit","last_synced_at":"2025-04-24T07:31:29.614Z","repository":{"id":40516283,"uuid":"326481483","full_name":"robertdebock/pre-commit","owner":"robertdebock","description":"Pre commit hooks for easier development.","archived":false,"fork":false,"pushed_at":"2024-05-13T12:28:26.000Z","size":55,"stargazers_count":21,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-13T13:39:08.841Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robertdebock.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":"2021-01-03T19:08:36.000Z","updated_at":"2024-05-13T13:39:17.153Z","dependencies_parsed_at":"2024-05-13T13:39:14.031Z","dependency_job_id":"6895a80d-a943-431f-95ae-67bf14314eda","html_url":"https://github.com/robertdebock/pre-commit","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fpre-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fpre-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fpre-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robertdebock%2Fpre-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robertdebock","download_url":"https://codeload.github.com/robertdebock/pre-commit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223944702,"owners_count":17229498,"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-11-10T11:22:30.615Z","updated_at":"2024-11-10T11:22:31.180Z","avatar_url":"https://github.com/robertdebock.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pre Commit\n\n## Recommended configuration\n\nHave all checks run:\n\n```yaml\nrepos:\n   - repo: https://github.com/robertdebock/pre-commit\n     rev: v1.5.3\n     hooks:\n       - id: ansible_role_find_unused_variable\n       - id: ansible_role_find_empty_files\n       - id: ansible_role_find_empty_directories\n       - id: ansible_role_fix_readability\n       - id: ansible_role_find_undefined_handlers\n       - id: ansible_role_find_unquoted_values\n       - id: ansible_role_find_horizontal_when\n```\n\nYou can also select single checks, read further for more details.\n\n## Ansible roles unused variable finder\n\nThis [pre-commit](https://pre-commit.com/) hook can help you find defined variables (in `defaults/main.yml` or `vars/main.yml`) that are not used in the role.\n\nExpand (or create) your `.pre-commit-config.yml` with this section:\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_find_unused_variable\n```\n\n## Ansible roles empty files finder\n\nThis hook can find empty `defaults/main.yml`, `handlers/main.yml` and `vars/main.yml` files.\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_find_empty_files\n```\n\nExtra parameter available:\n\n- `-l \u003cnumber\u003e`: number of minimum lines to declare that a file is empty (by default: 2)\n\n\n## Ansible roles empty directory finder\n\nThis hook can find empty directories.\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_find_empty_directory\n```\n\nExtra parameter available:\n\n- `-d \u003cnumber\u003e`: number of sub folder (maxdepth) to check (by default: 1)\n\n## Ansible roles readability fixer\n\nThis hook can improve readability.\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_fix_readability\n```\n\n## Ansible roles find undefined handler\n\nThis hook can find undefined handlers.\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_find_undefined_handlers\n```\n\nKnow bug:\n\n- doesn't detect notification in \"listener\".\n- doesn't work if notify have quote an not name of the handler task (or the opposite).\n\n\n## Ansible roles find unquoted values\n\nThis hook can find unquoted values.\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_find_unquoted_values\n```\n\n## Ansible roles find horizontal when\n\nThis hook can find when statements that can be spread vertically.\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_find_horizontal_when\n```\n\n\n## Parameters\n\nIt is possible to change the folder where the check is made.  To do that, add extra parameters:\n\n```yaml\nrepos:\n  - repo: https://github.com/robertdebock/pre-commit\n    rev: v1.5.3\n    hooks:\n      - id: ansible_role_find_horizontal_when\n        args: [-f roles/*]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fpre-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobertdebock%2Fpre-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobertdebock%2Fpre-commit/lists"}