{"id":13821010,"url":"https://github.com/zbindenren/cc","last_synced_at":"2025-05-07T09:02:35.261Z","repository":{"id":47079983,"uuid":"316535767","full_name":"zbindenren/cc","owner":"zbindenren","description":"A small go library to parse conventional commits and a cli to create a changelogs.","archived":false,"fork":false,"pushed_at":"2023-12-08T00:03:03.000Z","size":195,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T08:21:32.516Z","etag":null,"topics":["changelog","conventional-commits","git","go","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","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/zbindenren.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-11-27T15:22:05.000Z","updated_at":"2024-04-02T15:44:12.000Z","dependencies_parsed_at":"2024-06-21T02:16:44.133Z","dependency_job_id":"bdf61780-b0f2-4825-846e-4739873e67d5","html_url":"https://github.com/zbindenren/cc","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbindenren%2Fcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbindenren%2Fcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbindenren%2Fcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbindenren%2Fcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zbindenren","download_url":"https://codeload.github.com/zbindenren/cc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252847479,"owners_count":21813451,"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":["changelog","conventional-commits","git","go","parser"],"created_at":"2024-08-04T08:01:13.680Z","updated_at":"2025-05-07T09:02:35.234Z","avatar_url":"https://github.com/zbindenren.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**\n\n- [cc](#cc)\n  - [Changelog CLI](#changelog-cli)\n    - [Installation](#installation)\n    - [Configuration](#configuration)\n    - [Usage](#usage)\n    - [Markdown](#markdown)\n    - [Github Actions](#github-actions)\n  - [Library](#library)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/zbindenren/cc)](https://goreportcard.com/report/github.com/zbindenren/cc)\n[![Coverage Status](https://coveralls.io/repos/github/zbindenren/cc/badge.svg)](https://coveralls.io/github/zbindenren/cc)\n[![Build Status](https://github.com/zbindenren/cc/workflows/build/badge.svg)](https://github.com/zbindenren/cc/actions)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/zbindenren/cc)](https://pkg.go.dev/github.com/zbindenren/cc)\n\n# cc\nA small go library to parse [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) and a cli to create a changelogs.\n\n## Changelog CLI\nThe changelog cli creates and updates [CHANGELOG.md](./CHANGELOG.md) markdown files.\n\n### Installation\nYou can download a precompiled binary from the releases page or install it with go:\n\n```console\n$ go install github.com/zbindenren/cc/cmd/changelog@latest\n```\n\n\n### Configuration\nYou can create a default changelog configuration `.cc.yml` with `changelog -init-config`. This results in the following configuration:\n\n```yaml\nsections:\n    - type: build\n      title: Build System\n      hidden: true\n    - type: docs\n      title: Documentation\n      hidden: true\n    - type: feat\n      title: New Features\n      hidden: false\n    - type: fix\n      title: Bug Fixes\n      hidden: false\n    - type: refactor\n      title: Code Refactoring\n      hidden: true\n    - type: test\n      title: Test\n      hidden: true\n    - type: chore\n      title: Tasks\n      hidden: true\ngithub_project_path: \"\"\n```\n\nHidden sections will not show up in the resulting changelog. The default configuration creates [Gitlab](https://gitlab.com) Markdown.\nIf your our project is on Github, you have to add the project path to `.cc.yml`:\n\n```yaml\ngithub_project_path: zbindenren/cc\n```\n\n### Usage\nTo create a new release run:\n\n```\n$ changelog\nlast version: 0.2.1\nnext version: 0.3.0\ncreate release 0.3.0 (press enter to continue with this version or enter version):\n```\n\nThe proposed version corresponds to [Semantic Versioning](https://semver.org), but you can override the version, by entering a different one. The entered version can\nnot be below the current version.\n\nThe above command then performs the following tasks:\n\n* creates or update `CHANGELOG.md` file\n* stages (if necessary) and commits the changes\n* create a new version tag\n* and pushes everthing to remote\n\nIf you just want to see what happens, you can run `changelog -stdout`. With this option, no changes are applied to the git repository.\n\nIf you have already release tags in your project, you can create the old changelog with: `changelog -history \u003e CHANGELOG.md`. The history command always\nprints to stdout and performs no commits.\n\nTo see all available options run: `changelog -h`.\n\n### Markdown\nCommits of the form:\n\n```\nfeat(compiler): add 'comments' option\n```\n\n```\nfeat: add a new feature\n```\n\nlead to following Markdown:\n\n```markdown\n### New Features\n\n* **common** add a new feature ([a1f6009e](https://github.com/zbindenren/cc/commit/a1f6009e))\n* **compiler** add 'comments' option  ([aecbc18b](https://github.com/zbindenren/cc/commit/aecbc18b))\n```\n\nIf you add a footer with a issue reference `Closes: #1` or `Fixes: #1` like:\n\n```\nfix: a bug\n\nCloses: #1\n```\n\nyou get the following markdown:\n\n\n```markdown\n### Bug Fixes\n\n* **common** fix a bug ([#1](https://github.com/zbindenren/cc/issues/#1), [a1f6009e](https://github.com/zbindenren/cc/commit/a1f6009e))\n```\n\nIf you commit breaking changes:\n\n```\nfeat(server-cmd)!: remove option -a\n```\n\n```\nfeat(client-cmd): remove option -b\n\nBREAKING CHANGE: this change is introduced because ...\n```\n\nyou get the following markdown:\n\n```markdown\n### Breaking Changes\n\n* **server-cmd** remove option -a ([a1f6009e](https://github.com/zbindenren/cc/commit/a1f6009e))\n* **client-cmd** remove option -b ([a1f6009e](https://github.com/zbindenren/cc/commit/a1f6009e))\n  \u003e this change is introduced because ...\n```\n\nAn example can be found [here](./CHANGELOG.md).\n\n### Github Actions\n\nHere is an example how you can use the `changlog` tool to verify conventional commits in a github action:  [conventional-commits.yml](.github/workflows/conventional-commits.yml)\n\n\n## Library\nInstead of regular expressions, this package uses a lexer, that functions similarly to Rob Pike's discussion about lexer\ndesign in this [talk](https://www.youtube.com/watch?v=HxaD_trXwRE).\n\nThis library, parses a commit of the form:\n\n```\nfix: correct minor typos in code\n\nsee the issue for details\n\non typos fixed.\n\nReviewed-by: Z\nRefs #133\n```\n\ninto a struct:\n\n```go\n\u0026cc.Commit{\n  Header: cc.Header{\n    Type: \"fix\",\n    Scope: \"\",\n    Description: \"correct minor typos in code\",\n  },\n  Body: \"see the issue for details\\n\\non typos fixed.\",\n  Footer: cc.Footers{\n    cc.Footer{\n      Token: \"Reviewed-by\",\n      Value: \"Z\",\n    },\n    cc.Footer{\n      Token: \"Refs\",\n      Value: \"#133\",\n    },\n  },\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbindenren%2Fcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzbindenren%2Fcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbindenren%2Fcc/lists"}