EasyBuild.CommitParser
1.0.0
See the version list below for details.
dotnet add package EasyBuild.CommitParser --version 1.0.0
NuGet\Install-Package EasyBuild.CommitParser -Version 1.0.0
<PackageReference Include="EasyBuild.CommitParser" Version="1.0.0" />
paket add EasyBuild.CommitParser --version 1.0.0
#r "nuget: EasyBuild.CommitParser, 1.0.0"
// Install EasyBuild.CommitParser as a Cake Addin #addin nuget:?package=EasyBuild.CommitParser&version=1.0.0 // Install EasyBuild.CommitParser as a Cake Tool #tool nuget:?package=EasyBuild.CommitParser&version=1.0.0
EasyBuild.Parser
Common commit parser library used by other EasyBuild tools like EasyBuild.ChangelogGen or EasyBuild.CommitLinter.
Usage
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 Config.Config.decoder configContent with
| Ok config -> config
| Error error ->
failwithf "Error while parsing the configuration file: %s" error
Commit Format
[!NOTE] EasyBuild.CommitParser format is based on Conventional Commits and extends it to work in a monorepo environment.
<type>[optional scope][optional !]: <description>
[optional tags]
[optional body]
[optional footer]
[optional tags]
format is as follows:[tag1][tag2][tag3]
[optional body]
is a free-form text.This is a single line body.
This is a multi-line body.
[optional footer]
follows git trailer formatBREAKING CHANGE: <description> Signed-off-by: Alice <alice@example.com> Signed-off-by: Bob <bob@example.com>
Configuration
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 feature
If needed, you can provide a custom configuration either by code directly or by using a configuration file using JSON format.
Configuration File Format
The configuration file is a JSON file with the following properties:
types
- Required: ✅
- Type:
{ name: string, description?: string, skipTagLine?: 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. |
skipTagLine | bool | ❌ | If true skip the tag line validation. <br> If false , checks that the tag line format is valid and contains knows tags. <br><br>Default is true . |
tags
- Required: ❌
- Type:
string []
List of accepted commit tags.
Examples
{
"types": [
{ "name": "feat", "description": "A new feature", "skipTagLine": false },
{ "name": "fix", "description": "A bug fix", "skipTagLine": false },
{ "name": "docs", "description": "Documentation changes", "skipTagLine": false },
{ "name": "test", "description": "Adding missing tests or correcting existing tests", "skipTagLine": false },
{ "name": "style", "description": "Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", "skipTagLine": false },
{ "name": "refactor", "description": "A code change that neither fixes a bug nor adds a feature", "skipTagLine": 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" }
],
"tags": [
"cli",
"converter"
]
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- FSharp.Core (>= 8.0.101)
- FsToolkit.ErrorHandling (>= 4.15.1)
- Thoth.Json.Newtonsoft (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
## 1.0.0
### 🚀 Features
- Rework the API to be more like a library instead of an internal package ([4c6d03b](https://github.com/easybuild-org/EasyBuild.CommitParser/commit/4c6d03bb543b408fe3c74673a4ed55989fe177fa))