![]() |
VOOZH | about |
dotnet add package EasyBuild.CommitParser --version 3.0.0
NuGet\Install-Package EasyBuild.CommitParser -Version 3.0.0
<PackageReference Include="EasyBuild.CommitParser" Version="3.0.0" />
<PackageVersion Include="EasyBuild.CommitParser" Version="3.0.0" />Directory.Packages.props
<PackageReference Include="EasyBuild.CommitParser" />Project file
paket add EasyBuild.CommitParser --version 3.0.0
#r "nuget: EasyBuild.CommitParser, 3.0.0"
#:package EasyBuild.CommitParser@3.0.0
#addin nuget:?package=EasyBuild.CommitParser&version=3.0.0Install as a Cake Addin
#tool nuget:?package=EasyBuild.CommitParser&version=3.0.0Install as a Cake Tool
👁 NuGet
👁 alternate text is missing from this package README image
Common commit parser library used by other EasyBuild tools like EasyBuild.ChangelogGen or EasyBuild.CommitLinter.
It aims to provide helpful contextual error messages like:
Example of error messages:
Invalid commit message format.
Expected a commit message with the following format: '<type>[optional scope]: <description>'.
Where <type> is one of the following:
- feat: A new feature
- fix: A bug fix
- ci: Changes to CI/CD configuration
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
- docs: Documentation changes
- test: Adding missing tests or correcting existing tests
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- revert: Reverts a previous commit
- build: Changes that affect the build system or external dependencies
Example:
-------------------------
feat: some description
-------------------------
or
Unkonwn tag(s) in the footer.
Received:
- some-tag
But allowed tags are:
- converter
- web
open EasyBuild.CommitParser
open EasyBuild.CommitParser.Types
let commitText = "..."
// If you need the commit message information
Parser.tryParseCommitMessage CommitParserConfig.Default commitText
// > it: Result<CommitMessage,string>
// If you just want to validate the commit message
Parser.tryValidateCommitMessage CommitParserConfig.Default commitText
// > it: Result<unit,string>
For the configuration, you can use the default configuration or provide a custom one.
open EasyBuild.CommitParser.Types
// Default configuration
CommitParserConfig.Default
// My custom configuration
{
Types =
[
// ...
]
Tags =
[
// ...
] |> Some
}
// You can also use a configuration file by passing the JSON content to the included Decoder
open Thoth.Json.Newtonsoft
let configurationJson = "..."
match Decode.fromString CommitParserConfig.decoder configContent with
| Ok config -> config
| Error error ->
failwithf "Error while parsing the configuration file: %s" error
EasyBuild.CommitParser format is based on Conventional Commits
It add a special Tag footer, allowing it to be used in a mono-repo context.
Tools like EasyBuild.ChangelogGen can use the tag to filter the commits to include in the changelog.
<type>[optional scope][optional !]: <description>
[optional body]
[optional footer]
[optional body] is a free-form text.
This is a single line body.
This is a
multi-line body.
[optional footer] is inspired by git trailer format key: value but also allows key #value
BREAKING CHANGE: <description>
Signed-off-by: Alice <alice@example.com>
Signed-off-by: Bob <bob@example.com>
Refs #123
Tag: cli
💡 The Tag footer can be provided multiple times.
EasyBuild.CommitParser comes with a default configuration to validate your commit.
The default configuration allows the following commit types with no tags required:
feat - A new featurefix - A bug fixci - Changes to CI/CD configurationchore - Changes to the build process or auxiliary tools and libraries such as documentation generationdocs - Documentation changestest - Adding missing tests or correcting existing testsstyle - Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)refactor - A code change that neither fixes a bug nor adds a featureperf - A code change that improves performancerevert - Reverts a previous commitbuild - Changes that affect the build system or external dependenciesIf needed, you can provide a custom configuration either by code directly or by using a configuration file using JSON format.
The configuration file is a JSON file with the following properties:
{ name: string, description?: string, skipTagFooter?: bool } []List of accepted commit types.
| Property | Type | Required | Description |
|---|---|---|---|
| name | string | ✅ | The name of the commit type. |
| description | string | ❌ | The description of the commit type. |
| skipTagFooter | bool | ❌ | If true skip the tag footer validation. <br> If false, checks that the tag footer is provided and contains knows tags. <br><br>Default is true. |
string []List of accepted commit tags.
{
"types": [
{ "name": "feat", "description": "A new feature", "skipTagFooter": false },
{ "name": "perf", "description": "A code change that improves performance", "skipTagFooter": false },
{ "name": "fix", "description": "A bug fix", "skipTagFooter": false },
{ "name": "docs", "description": "Documentation changes", "skipTagFooter": false },
{ "name": "test", "description": "Adding missing tests or correcting existing tests", "skipTagFooter": false },
{ "name": "style", "description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", "skipTagFooter": false },
{ "name": "refactor", "description": "A code change that neither fixes a bug nor adds a feature", "skipTagFooter": false },
{ "name": "ci", "description": "Changes to CI/CD configuration" },
{ "name": "chore", "description": "Changes to the build process or auxiliary tools and libraries such as documentation generation" }
{ "name": "revert", "description": "Reverts a previous commit" }
{ "name": "build", "description": "Changes that affect the build system or external dependencies" }
],
"tags": [
"cli",
"converter"
]
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 netstandard2.1 is compatible. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
### 🏗️ Breaking changes
* Add `perf`, `revert` and `build` commit type to be on par with Angular convention (most common one) ([b77b4c5](https://github.com/easybuild-org/EasyBuild.CommitParser/commit/b77b4c54584108ec5d0dd9f77bfe5767dce203c8))
<strong><small>[View changes on Github](https://github.com/easybuild-org/EasyBuild.CommitParser/compare/6684bb1ef7f86e30dfb1e73adf1416791feb955d..58be601e5c49d31bace4ff8626d001f5d214619b)</small></strong>