From 79dcddffbbd2c91cf0866ecf5dc067669d3d32b9 Mon Sep 17 00:00:00 2001 From: Christoph Witzko <github@christophwitzko.com> Date: Sat, 17 Feb 2024 13:55:34 +0100 Subject: [PATCH] docs: explain release rules --- LICENSE | 2 +- README.md | 31 ++++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index cd92284..9d0524d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020 Christoph Witzko +Copyright (c) 2024 Christoph Witzko Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 70468bf..4f1679e 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,35 @@ A [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) analyze Refs #133 ``` +## Customizable Release Rules +It is possible to customize the release rules by providing options to the analyzer. The following options are available: + +| Option | Default | +|-----------------------|---------| +| `major_release_rules` | `*!` | +| `minor_release_rules` | `feat` | +| `patch_release_rules` | `fix` | + +⚠️ Commits that contain `BREAKING CHANGE(S)` in their body will always result in a major release. This behavior cannot be customized yet. + +### Rule Syntax +A rule may match a specific commit type, scope or both. The following syntax is supported: `<type>(<scope>)<modifier>` + +- `<type>`: The commit type, e.g. `feat`, `fix`, `refactor`. +- `<scope>`: The commit scope, e.g. `lang`, `config`. If left empty, the rule matches all scopes (`*`). +- `<modifier>`: The modifier, e.g. `!` for breaking changes. If left empty, the rule matches only commits without a modifier. +- A `*` may be used as a wildcard for a type, scope or modifier. + +### Example Rules +| Commit | `feat` (or `feat(*)` | `*!` (or `*(*)!`) | `chore(deps)` | `*🚀` | +|------------------------------------|----------------------|-------------------|---------------|-------| +| `feat(ui): add button component` | ✅ | ❌ | ❌ | ❌ | +| `feat!: drop support for Go 1.17` | ❌ | ✅ | ❌ | ❌ | +| `chore(deps): update dependencies` | ❌ | ❌ | ✅ | ❌ | +| `refactor: remove unused code` | ❌ | ❌ | ❌ | ❌ | +| `fix🚀: correct minor typos` | ❌ | ❌ | ❌ | ✅ | + + ## References - [Conventional Commit v1.0.0 - Examples](https://www.conventionalcommits.org/en/v1.0.0/#examples) @@ -45,4 +74,4 @@ A [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) analyze The [MIT License (MIT)](http://opensource.org/licenses/MIT) -Copyright © 2020 [Christoph Witzko](https://twitter.com/christophwitzko) +Copyright © 2024 [Christoph Witzko](https://twitter.com/christophwitzko) -- GitLab