|
| 1 | +# CC-GEN |
| 2 | + |
| 3 | +A generator of changelog from conventional commits. |
| 4 | + |
| 5 | +## Work in progress |
| 6 | + |
| 7 | +This program is a work in progress, some features works basically as intended, |
| 8 | +but more should be added and the code is quite messy. |
| 9 | +Use at your own risk! |
| 10 | + |
| 11 | +## Why? |
| 12 | + |
| 13 | +There are a lot of changelog generators out there, the reason for this one is |
| 14 | +that the ones already existing either did not work with lightweight tags |
| 15 | +or required a lot of extra things installed to work. |
| 16 | +The idea of cc-gen is to have a simple single binary which is easy to |
| 17 | +run and easy to modify both in form of code and the templates/configuration |
| 18 | +which is used to generate output. |
| 19 | + |
| 20 | +## How? |
| 21 | + |
| 22 | +There are currently two commands, `init` and `generate|gen`. |
| 23 | +The former creates a configuration file locally or globally which allows |
| 24 | +you to change the templates used to generate the changelogs. |
| 25 | +The later will generate a changelog. |
| 26 | + |
| 27 | +### Init |
| 28 | + |
| 29 | +The init command can be invoked with a --global flag, in which case it will |
| 30 | +create a .cc-gen file in your home directory with the default configuration. |
| 31 | + |
| 32 | +Without the --global flag, the file will be created in the directory where |
| 33 | +the command was invoked. |
| 34 | + |
| 35 | +The following configuration values are available: |
| 36 | + |
| 37 | +`Header` - The header of the changelog, defaults to '# Change Log' |
| 38 | +`GroupBreakingChanges` - If any breaking changes should have their own section |
| 39 | +in the changelog, defaults to true. |
| 40 | +`GroupBreakingHeader` - Header for breaking changes, defautls to '## Breaking changes' |
| 41 | +`Type` - Template for 'Types' |
| 42 | +`DefaultType` - Type any non-matched commits will go under (commits following cc but not found in TypeMap) |
| 43 | +`TypeMap` - A map of 'types' and their possible values in the commit messages |
| 44 | +`BreakingCommit` - Template for breaking changes, only used if 'GroupBreakingChanges' is false |
| 45 | +`Commit` - Template for commits |
| 46 | + |
| 47 | + |
| 48 | +```text |
| 49 | +Default for 'Commit': |
| 50 | + * [ {{ commit.sha | string.slice1 0 6 }} ] {{ header }} ({{ commit.committer.name }}) {{ commit.committer.when }} |
| 51 | +
|
| 52 | +Default for 'BreakingCommit' |
| 53 | + * [ {{ commit.sha | string.slice1 0 6 }} ] **breaking** {{ header }} ({{ commit.committer.name }}) {{ commit.committer.when }} |
| 54 | +``` |
| 55 | + |
| 56 | +_Will later fill this part with a bit more information on what is passed to the template engine, |
| 57 | +for now, check the 'Conventional.cs' class_ |
| 58 | + |
| 59 | +## With what? |
| 60 | + |
| 61 | +The application makes use of [LibGit2Sharp](https://github.com/libgit2/libgit2sharp/) to |
| 62 | +work with the git log and [Scriban](https://github.com/scriban/scriban) to handle the templates. |
| 63 | +The command line helper used is [System.CommandLine](https://github.com/dotnet/command-line-api) |
| 64 | +and tests makes use of [XUnit](https://xunit.net/) and [Moq](https://github.com/moq/moq) |
0 commit comments