Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mbamber/cov-commit-parser
Simple parser for Conventional Commits: https://www.conventionalcommits.org/en/v1.0.0/)
https://github.com/mbamber/cov-commit-parser
go semver
Last synced: 3 months ago
JSON representation
Simple parser for Conventional Commits: https://www.conventionalcommits.org/en/v1.0.0/)
- Host: GitHub
- URL: https://github.com/mbamber/cov-commit-parser
- Owner: mbamber
- License: mit
- Created: 2020-07-19T14:43:22.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-19T14:00:28.000Z (almost 4 years ago)
- Last Synced: 2024-08-03T23:29:20.495Z (6 months ago)
- Topics: go, semver
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-golang-repositories - cov-commit-parser
README
# Cov Commit Parser
![CD](https://github.com/mbamber/cov-commit-parser/workflows/CD/badge.svg)A simple parser for [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
## Usage
When run without any arguments, `ccp version` will parse the commits at the current HEAD and output a single line containing a version number. This version number is the recommended version to use for the next build, based on the commit messages included since the latest tag on the branch.The current version number is determined by the tag representing the latest semantic version. This can be overridden using the `--current` flag.
Use the `--since` flag to specify a commit hash, branch name or tag to adjust the commits used during the parsing.
### Use as a library
The tool can also be embedded into existing Go programs. The example below returns a new version based on the starting version `1.0.0` and using the single commit on the `HEAD` of a git repository in the directory `repo_path`:
```go
commitMessages, err := git.GetCommitsInDirectory("repo_path", "HEAD~1", "HEAD")
if err != nil {
fmt.Printf("Error: %s", err.Error())
}v, err := ccp.GetNextVersion("1.0.0", commitMessages, ccp.DefaultPatchTypes)
if err != nil {
fmt.Printf("Error: %s", err.Error())
}fmt.Println(v)
```