opensource-nepal / commitlint

commitlint is a tool designed to lint your commit messages according to the Conventional Commits standard for your pre-commit hook and GitHub Actions.
GNU General Public License v3.0
16 stars 9 forks source link

Doc for CLI usage #29

Closed aj3sh closed 3 months ago

aj3sh commented 3 months ago

Currently, there is no documentation regarding the CLI. Let's add it to the README.md.

Here are some details for the CLI. Let's use them and write standard documentation after the For github-actions section of How to use.

$ commitlint --help
usage: commitlint [-h] [-V] [--file FILE] [--hash HASH] [--from-hash FROM_HASH] [--to-hash TO_HASH] [--skip-detail] [commit_message]

Check if a commit message follows the conventional commit format.

positional arguments:
  commit_message        The commit message to be checked.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  --file FILE           Path to a file containing the commit message.
  --hash HASH           Commit hash
  --from-hash FROM_HASH
                        From commit hash
  --to-hash TO_HASH     To commit hash
  --skip-detail         Skip the detailed error message check

Example usage:

Check commit message directly:

$ commitlint "chore: my commit message"

Check commit message from file:

$ commitlint --file /foo/bar/commit-message.txt

Check commit message of a hash:

$ commitlint --hash 9a8c08173

Check commit message of a hash range:

$ commitlint --from-hash 00bf73fef7 --to-hash d6301f1eb0

Check commit message skipping the detail check:

$ commitlint --skip-detail "chore: my commit message"
# or
$ commitlint --skip-detail --hash 9a8c08173

Display help

$ commitlint --help
# or
$ commitlint -h

Displaying version

$ commitlint --version
# or
$ commitlint -V
martincarapia commented 3 months ago

What's a CLI? I'd love to add it to the readme but I don't know what it is.

aj3sh commented 3 months ago

Hello @martincarapia, our tool commitlint can be utilized as a Command Line Interface (CLI), and currently, we don't have proper documentation for its usage. I will be adding a detailed description of the CLI.

martincarapia commented 3 months ago

Oh alright. Thank you for the explanation!

aj3sh commented 3 months ago

I have updated the description :-)

martincarapia commented 3 months ago

Awesome, I'll get started.