go-conventionalcommit-lint

command module
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2025 License: MIT Imports: 1 Imported by: 0

README

go-conventionalcommit-lint

Release GitHub Tag Docker image version Go Report Card GitHub Sponsors

Slightly opinionated and functional linter for conventional commits written in go. This linter covers the convention essentials and does not aim to support all kinds of variations and custom rules!

Features

  • Checks for header syntax
  • Checks for common typos on the most important keywords: fix, feat and BREAKING CHANGE
  • Supports creating pull github pull request reviews
    • Supports request for changes (default)
    • Supports commenting only
  • Supports linting only the current commit
  • Supports linting all commits
  • Supports linting only most recent commits from base branch

How it works

go-conventionalcommit-lint will check your commits against the conventional commits standard, and let you know if there are any issues, when running on github actions and if you enable creation of pull request reviews it will create a pull request review for you.

Installation

Github action

TBA

Docker

You can run go-conventionalcommit-lint with docker, containers are provided both on dockerhub and ghcr.io

ghcr.io

docker run -v $(pwd):/data --rm ghcr.io/coolapso/go-conventionalcommit-lint:latest

dockerhub:

docker run -v $(pwd):/data --rm coolapso/go-conventionalcommit-lint:latest
Go Install
Latest version

go install github.com/coolapso/go-conventionalcommit-lint@latest

Specific version

go install github.com/coolapso/go-conventionalcommit-lint@v1.0.0

AUR

On Arch linux you can use the AUR go-conventionalcommit-lint-bin

Linux Script

It is also possible to install on any linux distro with the installation script

Latest version
curl -L http://commitlint.coolapso.sh/install.sh | bash
Specific version
curl -L http://commitlint.coolapso.sh/install.sh | VERSION="v1.1.0" bash
Manual install
  • Grab the binary from the releases page.
  • Extract the binary
  • Execute it

Usage

Usage:
  commitlint [flags]
  commitlint [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Print go-conventionalcommit-lint version

Flags:
  -b, --base-branch string   The base branch to check commits from (default "main")
      --comment-only         Pull request reviews will only comment instead of requesting changes
  -r, --create-review        Creates review on github pull request
  -c, --current              Lint only the current commit
  -h, --help                 help for commitlint
  -a, --lint-all             Lint all repository commits
  -p, --path string          Git repository path (default "./")
      --pr-number int        The number of pull request to create the review
      --repository string    The github repository in owner/name format ex: coolapso/go-conventionalcommit-lint

Use "commitlint [command] --help" for more information about a command.

Build

`go build -o convcommitlint

Contributions

Improvements and suggestions are always welcome, feel free to check for any open issues, open a new Issue or Pull Request

If you like this project and want to support / contribute in a different way you can always ❤ Sponsor Me or

Buy Me A Coffee

Also consider supporting tapio/live-server which inspired this project

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL