{"id":17195198,"url":"https://github.com/luoxue-victor/commitlint","last_synced_at":"2025-07-09T20:34:31.987Z","repository":{"id":41407128,"uuid":"222377959","full_name":"luoxue-victor/commitlint","owner":"luoxue-victor","description":"开箱即用的代码提交规范","archived":false,"fork":false,"pushed_at":"2021-04-19T07:03:44.000Z","size":160,"stargazers_count":56,"open_issues_count":4,"forks_count":28,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-03T16:45:39.651Z","etag":null,"topics":["commitlint","vue-cli3"],"latest_commit_sha":null,"homepage":"","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/luoxue-victor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-11-18T06:26:02.000Z","updated_at":"2024-10-15T06:43:07.000Z","dependencies_parsed_at":"2022-07-06T11:10:02.688Z","dependency_job_id":null,"html_url":"https://github.com/luoxue-victor/commitlint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/luoxue-victor/commitlint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxue-victor%2Fcommitlint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxue-victor%2Fcommitlint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxue-victor%2Fcommitlint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxue-victor%2Fcommitlint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luoxue-victor","download_url":"https://codeload.github.com/luoxue-victor/commitlint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luoxue-victor%2Fcommitlint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264502989,"owners_count":23618672,"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":["commitlint","vue-cli3"],"created_at":"2024-10-15T01:49:41.638Z","updated_at":"2025-07-09T20:34:31.969Z","avatar_url":"https://github.com/luoxue-victor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Git commit 规范\n\n结合 `commitizen` `commitlint` `conventional-changelog-cli` `husky`，进行封装，一键安装，开箱即用的 `git commit` 规范。\n\n## 功能\n\n1. 自动检测 commit 是否规范，不规范不允许提交\n2. 自动提示 commit 填写格式。不怕忘记规范怎么写\n3. 集成 git add . \u0026\u0026 git commit 不需要在执行两个命令\n4. 自动生成 changelog\n\n## 配置\n\n1. 如果您是 vue-cli3 的项目可以直接使用即可\n\n```bash\nvue add commitlint\n```\n\n2. 如果您不是 vue-cli3 的项目\n\n```bash\nnpm i vue-cli-plugin-commitlint commitizen commitlint conventional-changelog-cli husky -D\n```\n\n- 在 package.json 中添加\n\n```json\n{\n  \"scripts\": {\n    \"log\": \"conventional-changelog --config ./node_modules/vue-cli-plugin-commitlint/lib/log -i CHANGELOG.md -s -r 0\",\n    \"cz\": \"npm run log \u0026\u0026 git add . \u0026\u0026 git cz\"\n  },\n  \"husky\": {\n    \"hooks\": {\n      \"commit-msg\": \"commitlint -E HUSKY_GIT_PARAMS\"\n    }\n  },\n  \"config\": {\n    \"commitizen\": {\n      \"path\": \"./node_modules/vue-cli-plugin-commitlint/lib/cz\"\n    }\n  }\n}\n```\n\n增加 commitlint.config.js 文件\n\n```js\nmodule.exports = {\n  extends: ['./node_modules/vue-cli-plugin-commitlint/lib/lint']\n};\n```\n\n## 使用\n\n```bash\nnpm run cz  # git add . \u0026\u0026 git commit -m 'feat:(xxx): xxx'\nnpm run log # 生成 CHANGELOG\n```\n\n1. 代码提交 npm run cz\n\n![commander](./public/commander.png)\n\n2. 选择一个类型会自动询问\n\n    1. (非必填）本次提交的改变所影响的范围\n    2. (必填）写一个简短的变化描述\n    3. (非必填）提供更详细的变更描述\n    4. (非必填)是否存在不兼容变更?\n    5. (非必填)此次变更是否影响某些打开的 issue \n \n![prompt](./public/prompt.png)\n\n### changelog 演示\n\n![changelog](./public/changelog.png)\n\n## 规则\n\n| 规范名   | 描述                                                    |\n| -------- | ------------------------------------------------------- |\n| docs     | 仅仅修改了文档，比如 README, CHANGELOG, CONTRIBUTE 等等 |\n| chore    | 改变构建流程、或者增加依赖库、工具等                    |\n| feat     | 新增 feature                                            |\n| fix      | 修复 bug                                                |\n| merge    | 合并分之                                                |\n| perf     | 优化相关，比如提升性能、体验                            |\n| refactor | 代码重构，没有加新功能或者修复 bug                      |\n| revert   | 回滚到上一个版本                                        |\n| style    | 仅仅修改了空格、格式缩进、都好等等，不改变代码逻辑      |\n| test     | 测试用例，包括单元测试、集成测试等                      |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxue-victor%2Fcommitlint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluoxue-victor%2Fcommitlint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluoxue-victor%2Fcommitlint/lists"}