{"id":15003443,"url":"https://github.com/lukebrobbs/commit-hooks","last_synced_at":"2026-03-17T15:03:01.549Z","repository":{"id":34562250,"uuid":"180213223","full_name":"lukebrobbs/commit-hooks","owner":"lukebrobbs","description":"Pre defined Configurable Pre commit hooks","archived":false,"fork":false,"pushed_at":"2022-12-30T17:26:43.000Z","size":722,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-19T01:47:09.153Z","etag":null,"topics":["git","hooks","pre-commit"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/lukebrobbs.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":"2019-04-08T18:52:12.000Z","updated_at":"2019-11-06T16:00:55.000Z","dependencies_parsed_at":"2023-01-15T08:00:30.708Z","dependency_job_id":null,"html_url":"https://github.com/lukebrobbs/commit-hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrobbs%2Fcommit-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrobbs%2Fcommit-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrobbs%2Fcommit-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukebrobbs%2Fcommit-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukebrobbs","download_url":"https://codeload.github.com/lukebrobbs/commit-hooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243154747,"owners_count":20244985,"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":["git","hooks","pre-commit"],"created_at":"2024-09-24T18:58:30.579Z","updated_at":"2025-12-24T14:28:50.840Z","avatar_url":"https://github.com/lukebrobbs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Commit Hooks\n\n[![CircleCI](https://circleci.com/gh/lukebrobbs/commit-hooks.svg?style=svg)](https://circleci.com/gh/lukebrobbs/commit-hooks)\u0026nbsp;\u0026nbsp;\u0026nbsp;[![codecov](https://codecov.io/gh/lukebrobbs/commit-hooks/branch/master/graph/badge.svg)](https://codecov.io/gh/lukebrobbs/commit-hooks)\u0026nbsp;\u0026nbsp;\u0026nbsp;[![npmVersion](https://img.shields.io/npm/v/ddc-commit-hooks.svg)](https://www.npmjs.com/package/ddc-commit-hooks)\n\nDDC-Commit-Hooks is designed to allow the implementation of pre-defined tasks to be implemented during git hooks. These tasks are intended to maximise code quality.\n\n---\n\n## Install\n\n```sh\nnpm install ddc-commit-hooks --save-dev\n```\n\n## Run\n\nTo run the package, add the following to your npm scripts:\n\n```sh\nddc-commit\n```\n\nthis can be followed by the following options :\n\n`-preCommit` - To run all user defined pre commit hooks\n\n`-commitMsg` - To run all user defined commit-message hooks\n\nIt is recomended to use this package with [Husky](https://github.com/typicode/husky). Configuration would look as follows:\n\n```js\n// .huskyrc\n{\n  \"hooks\": {\n    \"pre-commit\": \"npm test \u0026\u0026 ddc-commit -preCommit\",\n    \"commit-msg\": \"ssc-commit -commitMsg\"\n  }\n}\n```\n\n## Configuration\n\nTo configure Hooks, create a `.commithooksrc` file.\n\n```js\n// .commithooksrc\n{\n  \"preCommit\": {\n    \"maxFileSize\": 2,\n    \"esLintCheck\": true\n  }\n}\n```\n\nIt is also possible to create a `commithooks.json` to achieve the same result (Note - content in the `.commithooksrc` file will override `commithooks.json`)\n\n---\n\n## Options\n\nThe following options are available in v1.0.0 :\n\n### preCommit\n\nAny of these properties will work inside a `preCommit` key:\n\n| Property         | Type      | Default | Description                                        |\n| ---------------- | --------- | ------- | -------------------------------------------------- |\n| **gitlabCi**     | `Boolean` | `false` | Checks for the presence of a `.gitlab-ci.yml` file |\n| **circleCi**     | `Boolean` | `false` | Checks for the presence of a `.circleci` directory |\n| **esLintCheck**  | `Boolean` | `false` | Checks for the presence of a `.eslintrc` file      |\n| **maxFileSize**  | `Number`  | `2`     | Max size in mb allowed for any single file         |\n| **cypress**      | `String`  | `\"\"`    | Directory of cypress tests if applicable           |\n| **robot**        | `String`  | `\"\"`    | Directory of Robot Framework tests if applicable   |\n| **dotOnlyCheck** | `Boolean` | `false` | Searches test files for .only                      |\n\n### commitMsg\n\nAny of these properties will work inside a `commitMsg` key, and will be run on the users commit message:\n\n| Property            | Type     | Default | Description                                     |\n| ------------------- | -------- | ------- | ----------------------------------------------- |\n| **_glob_**          | `Regex`  | `\". *\"` | Regex patter to check for in the commit title   |\n| **_maxLineLength_** | `Number` | `79`    | Set max line length allowed in a commit message |\n| **_titleLength_**   | `Number` | `25`    | Sets max length for a commit title              |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukebrobbs%2Fcommit-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukebrobbs%2Fcommit-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukebrobbs%2Fcommit-hooks/lists"}