EasyBuild.CommitLinter
0.1.0
See the version list below for details.
dotnet tool install --global EasyBuild.CommitLinter --version 0.1.0
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local EasyBuild.CommitLinter --version 0.1.0
#tool dotnet:?package=EasyBuild.CommitLinter&version=0.1.0
nuke :add-package EasyBuild.CommitLinter --version 0.1.0
EasyBuild.CommitLinter
EasyBuild.CommitLinter is a .NET tool to lint your commit messages. It checks if the commit message follows the commit format described below.
[!TIP] EasyBuild.CommitLinter has a companion tool called EasyBuild.ChangelogGen which generates a changelog based on the Git history.
Usage
# Install the tool
dotnet tool install EasyBuild.CommitLinter
# Run the tool
dotnet commit-linter --help
DESCRIPTION:
Lint your commit message based on EasyBuild.CommitLinter conventions
Learn more at https://github.com/easybuild-org/EasyBuild.CommitLinter
USAGE:
commit-linter <commit-file> [OPTIONS]
ARGUMENTS:
<commit-file> Path to the commit message file
OPTIONS:
-h, --help Prints help information
-v, --version Prints version information
-c, --config Path to the configuration file
Husky Integration
If you are using Husky, you can register the CLI as a commit-msg
hook to validate your commit messages by running:
dotnet husky add commit-msg -c 'dotnet commit-linter "$1"'
# $1 is provided by Husky and contains the path to the commit message file
Commit Format
[!NOTE] EasyBuild.CommitLinter 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.CommitLinter 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 file by using the --config
option.
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 | net6.0 is compatible. 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. |
This package has no dependencies.
## 0.1.0
### 🚀 Features
- Add a top level description for the CLI app ([e60ab34](https://github.com/easybuild-org/EasyBuild.FileSystemProvider/commit/e60ab349637d7bc602542b5f378d465e93423960))
- Allows to provide relative or absolute path for the config / commit file ([9cc4622](https://github.com/easybuild-org/EasyBuild.FileSystemProvider/commit/9cc46228b09823ff4a7d0f43d2b649910bb599b2))
- Initial implementation ([94e97b5](https://github.com/easybuild-org/EasyBuild.FileSystemProvider/commit/94e97b5b06bc351d9419235df3e4af13cb45f121))
### 🐞 Bug Fixes
- Improve formatting in case of invalid format ([b511088](https://github.com/easybuild-org/EasyBuild.FileSystemProvider/commit/b5110881d905234aef41b12c96efd307909f99dc))
- Include FSharp.Core in the generated tool ([2c3d605](https://github.com/easybuild-org/EasyBuild.FileSystemProvider/commit/2c3d605e12e2bced3a01333fc14513f135e05d5a))