Skip to content

Commit b5473f2

Browse files
committed
docs(readme): Add more details
1 parent 1e29c0f commit b5473f2

1 file changed

Lines changed: 162 additions & 76 deletions

File tree

README.md

Lines changed: 162 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,147 +3,233 @@
33
</p>
44

55
# CONVCOMMITLINT
6+
67
[![Release](https://github.com/coolapso/convcommitlint/actions/workflows/release.yaml/badge.svg?branch=main)](https://github.com/coolapso/convcommitlint/actions/workflows/release.yaml)
78
![GitHub Tag](https://img.shields.io/github/v/tag/coolapso/convcommitlint?logo=semver&label=semver&labelColor=gray&color=green)
89
[![Docker image version](https://img.shields.io/docker/v/coolapso/convcommitlint/latest?logo=docker)](https://hub.docker.com/r/coolapso/convcommitlint)
910
[![Go Report Card](https://goreportcard.com/badge/github.com/coolapso/convcommitlint)](https://goreportcard.com/report/github.com/coolapso/convcommitlint)
1011
![GitHub Sponsors](https://img.shields.io/github/sponsors/coolapso?style=flat&logo=githubsponsors)
1112

12-
A simple, slightly opinionated, yet usable linter for [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/), written in Go.
13-
This linter covers the convention essentials, contributions are wellcome but, no! I don't intend to support all kinds of variations and custom rules!
13+
A simple, slightly opinionated, but actually *usable* linter for [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), written in Go.
14+
15+
---
1416

1517
## Motivation
1618

17-
I just wanted something simple that works, not configure all kinds of things just to get a linter working!
19+
I just wanted something that *works* out of the box. No over-configuration, no headaches—just simple commit linting! This being said, this linter covers the essentials. Contributions are welcome, but I don’t intend to support every possible variation or custom rule!
20+
21+
---
1822

1923
## Features
2024

21-
* Checks for header syntax
22-
* Checks for common typos on the most important keywords: fix, feat and BREAKING CHANGE
23-
* Supports creating pull github pull request reviews
24-
* Supports request for changes (default)
25-
* Supports commenting only
26-
* Supports linting only the current commit
27-
* Supports linting all commits
28-
* Supports linting only most recent commits from base branch
25+
- **Checks header syntax**
26+
- **Detects common typos** in key keywords: `fix`, `feat`, and `BREAKING CHANGE`
27+
- **GitHub Pull Request Reviews:**
28+
- Request changes (default)
29+
- Comment-only mode
30+
- **Lint Modes:**
31+
- Lint only the current commit
32+
- Lint all commits
33+
- Lint only recent commits from the base branch
34+
- **Full environment variable support** for all flags
35+
- **Cross-platform:** Linux, macOS, and Windows
36+
- **GitHub Action** support
2937

30-
## How it works
38+
---
3139

32-
convcommitlint will check your commits against the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) 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.
40+
## How It Works
3341

34-
## Installation
42+
`convcommitlint` checks your commits against the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard.
43+
If you use it as a GitHub Action or enable PR review, it will comment or request changes directly on your pull requests, listing any issues it finds.
3544

36-
### Github action
45+
---
3746

38-
Github action is available to use with your CI pipelines and most arguments from the CLI application are available.
47+
## Usage
3948

4049
```
41-
convcommitlint:
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@v4
45-
- uses: coolapso/convcommitlint@v0
50+
convcommitlint [flags]
51+
convcommitlint [command]
52+
53+
Available Commands:
54+
completion Generate the autocompletion script for the specified shell
55+
help Help about any command
56+
version Print convcommitlint version
57+
58+
Flags:
59+
-b, --base-branch string The base branch to check commits from (default "main")
60+
--comment-only Pull request reviews will only comment instead of requesting changes
61+
-r, --create-review Creates review on github pull request
62+
-c, --current Lint only the current commit
63+
-h, --help help for convcommitlint
64+
-a, --lint-all Lint all repository commits
65+
-p, --path string Git repository path (default "./")
66+
--pr-number int The number of pull request to create the review
67+
--repository string The github repository in owner/name format ex: coolapso/convcommitlint
68+
69+
Use "convcommitlint [command] --help" for more information about a command.
4670
```
71+
<p align="center">
72+
<img src="https://raw.githubusercontent.com/coolapso/convcommitlint/refs/heads/main/images/demo.gif">
73+
</p>
4774

48-
You can find the available inputs in the [action.yaml](action.yaml) file, if a input is not available you still should be able to use it by setting the associated ENV variable.
4975

50-
> [!IMPORTANT]
51-
> Be sure to include the Checkout in your workflow, this action won't do it for you!
76+
### Environment Variables
5277

53-
### Docker
78+
Every flag can also be set with an environment variable, using the `CONVCOMMITLINT_` prefix, uppercase, and underscores.
79+
For example, the flag `--lint-all` becomes the variable `CONVCOMMITLINT_LINT_ALL`.
80+
81+
---
5482

55-
You can run convcommitlint with docker, containers are provided both on dockerhub and ghcr.io
83+
## GitHub Action
5684

57-
**ghcr.io**
85+
You can use `convcommitlint` as part of your CI pipeline. Most CLI arguments are supported as action inputs.
5886

87+
```yaml
88+
convcommitlint:
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v4
92+
- uses: coolapso/convcommitlint@v0
5993
```
60-
docker run -v $(pwd):/data --rm ghcr.io/coolapso/convcommitlint:latest
94+
95+
### Base Branch
96+
97+
By default, the base branch is `"main"`. If you use a different default branch, set the `base-branch` input:
98+
99+
```yaml
100+
convcommitlint:
101+
runs-on: ubuntu-latest
102+
steps:
103+
- uses: actions/checkout@v4
104+
- uses: coolapso/convcommitlint@v0
105+
with:
106+
base-branch: develop
61107
```
62108

63-
**dockerhub:**
109+
### Git History Depth
110+
111+
By default, the action checks out the reference branch with full history. To limit this, use the `fetch-depth` input (commits beyond this depth will *not* be analyzed):
64112

113+
```yaml
114+
convcommitlint:
115+
runs-on: ubuntu-latest
116+
steps:
117+
- uses: actions/checkout@v4
118+
- uses: coolapso/convcommitlint@v0
119+
with:
120+
fetch-depth: 10
65121
```
66-
docker run -v $(pwd):/data --rm coolapso/convcommitlint:latest
122+
123+
### Disable Pull Request Reviews
124+
125+
PR reviews are enabled by default. To disable them, set `create-review` to `"false"`:
126+
127+
```yaml
128+
convcommitlint:
129+
runs-on: ubuntu-latest
130+
steps:
131+
- uses: actions/checkout@v4
132+
- uses: coolapso/convcommitlint@v0
133+
with:
134+
create-review: "false"
67135
```
68136

69-
### Go Install
137+
### Use a Specific Version
70138

71-
#### Latest version
139+
The action uses the latest release by default. To pin a specific version:
72140

73-
`go install github.com/coolapso/convcommitlint@latest`
141+
```yaml
142+
convcommitlint:
143+
runs-on: ubuntu-latest
144+
steps:
145+
- uses: actions/checkout@v4
146+
- uses: coolapso/convcommitlint@v0
147+
with:
148+
version: v0.2.0
149+
```
74150

75-
#### Specific version
151+
### Other Features & Flags
76152

77-
`go install github.com/coolapso/convcommitlint@v1.0.0`
153+
The action supports all CLI features and flags.
154+
Check available inputs in [`action.yaml`](action.yaml).
155+
If an input is missing, you can always set the corresponding environment variable.
78156

79-
### AUR
157+
---
80158

81-
On Arch linux you can use the AUR `convcommitlint-bin`
159+
## Installation
82160

83-
### Linux Script
161+
### Docker
84162

85-
It is also possible to install on any linux distro with the installation script
163+
Images are available on both DockerHub and GitHub Container Registry (ghcr.io):
86164

87-
#### Latest version
165+
**GitHub Container Registry:**
88166

167+
```sh
168+
docker run -v $(pwd):/data --rm ghcr.io/coolapso/convcommitlint:latest
89169
```
90-
curl -L http://commitlint.coolapso.sh/install.sh | bash
170+
171+
**DockerHub:**
172+
173+
```sh
174+
docker run -v $(pwd):/data --rm coolapso/convcommitlint:latest
91175
```
92176

93-
#### Specific version
177+
### Go Install
178+
179+
#### Latest Version
94180

181+
```sh
182+
go install github.com/coolapso/convcommitlint@latest
95183
```
96-
curl -L http://commitlint.coolapso.sh/install.sh | VERSION="v1.1.0" bash
184+
185+
#### Specific Version
186+
187+
```sh
188+
go install github.com/coolapso/convcommitlint@v1.0.0
97189
```
98190

99-
### Manual install
191+
### Arch Linux (AUR)
100192

101-
* Grab the binary from the [releases page](https://github.com/coolapso/convcommitlint/releases).
102-
* Extract the binary
103-
* Execute it
193+
On Arch Linux, use the AUR package: `convcommitlint-bin`.
104194

195+
### Linux Install Script
105196

106-
## Usage
197+
Install on any Linux distro using the script:
198+
199+
#### Latest Version
107200

201+
```sh
202+
curl -L http://commitlint.coolapso.sh/install.sh | bash
108203
```
109-
Usage:
110-
convcommitlint [flags]
111-
convcommitlint [command]
112204

113-
Available Commands:
114-
completion Generate the autocompletion script for the specified shell
115-
help Help about any command
116-
version Print convcommitlint version
205+
#### Specific Version
117206

118-
Flags:
119-
-b, --base-branch string The base branch to check commits from (default "main")
120-
--comment-only Pull request reviews will only comment instead of requesting changes
121-
-r, --create-review Creates review on github pull request
122-
-c, --current Lint only the current commit
123-
-h, --help help for convcommitlint
124-
-a, --lint-all Lint all repository commits
125-
-p, --path string Git repository path (default "./")
126-
--pr-number int The number of pull request to create the review
127-
--repository string The github repository in owner/name format ex: coolapso/convcommitlint
128-
129-
Use "convcommitlint [command] --help" for more information about a command.
207+
```sh
208+
curl -L http://commitlint.coolapso.sh/install.sh | VERSION="v1.1.0" bash
130209
```
131210

132-
## Build
133211

134-
`go build -o convcommitlint
212+
### Manual Install
135213

136-
# Contributions
214+
- Download the binary from the [releases page](https://github.com/coolapso/convcommitlint/releases)
215+
- Extract the binary
216+
- Run it
137217

138-
Improvements and suggestions are always welcome, feel free to check for any open issues, open a new Issue or Pull Request
218+
### Build
139219

140-
If you like this project and want to support / contribute in a different way you can always [:heart: Sponsor Me](https://github.com/sponsors/coolapso) or
220+
```sh
221+
go build -o convcommitlint
222+
```
141223

142-
<a href="https://www.buymeacoffee.com/coolapso" target="_blank">
143-
<img src="https://cdn.buymeacoffee.com/buttons/default-yellow.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" />
144-
</a>
224+
---
145225

226+
## Contributions
146227

228+
Improvements and suggestions are always welcome!
229+
Check open issues, or open a new Issue or Pull Request.
147230

148-
Also consider supporting [tapio/live-server](https://github.com/tapio/live-server) which inspired this project
231+
If you like this project and want to support or contribute in another way, you can [:heart: Sponsor Me](https://github.com/sponsors/coolapso) or:
149232

233+
<a href="https://www.buymeacoffee.com/coolapso" target="_blank">
234+
<img src="https://cdn.buymeacoffee.com/buttons/default-yellow.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" />
235+
</a>

0 commit comments

Comments
 (0)