From bba93516798c905b204b7059cc591987492722f2 Mon Sep 17 00:00:00 2001 From: Martin C <78377730+MilkManMaki@users.noreply.github.com> Date: Thu, 4 Apr 2024 12:28:59 -0400 Subject: [PATCH 1/2] docs: update readme to include CLI --- README.md | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/README.md b/README.md index 7fefa95..8bb6281 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,71 @@ jobs: | 1 | **exit_code** | Integer | The exit code of the commitlint step. | | 2 | **status** | String | The outcome of the commitlint step. Possible values: 'success' or 'failure'. | + +## CLI (Command Line Interface) + +### Help Example +```shell +$ 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 +``` + +### Usage Examples +Check commit message directly: + +```shell +$ commitlint "chore: my commit message" +``` + +Check commit message from file: + +```shell +$ commitlint --file /foo/bar/commit-message.txt +``` + +Check commit message of a hash: + +```shell +$ commitlint --hash 9a8c08173 +``` + +Check commit message of a hash range: + +```shell +$ commitlint --from-hash 00bf73fef7 --to-hash d6301f1eb0 +``` + +Check commit message skipping the detail check: + +```shell +$ commitlint --skip-detail "chore: my commit message" +# or +$ commitlint --skip-detail --hash 9a8c08173 +``` + +Version check: + +```shell +$ commitlint --version +# or +$ commitlint -V +``` + ## Contribution We appreciate feedback and contribution to this package. To get started please see our [contribution guide](./CONTRIBUTING.md). From 1715195f6267c0be3e2a36c7b75f988d8c576df4 Mon Sep 17 00:00:00 2001 From: Martin C <78377730+MilkManMaki@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:16:48 -0400 Subject: [PATCH 2/2] docs: fix readme to adjust to change requests --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8bb6281..3800639 100644 --- a/README.md +++ b/README.md @@ -86,8 +86,14 @@ jobs: ## CLI (Command Line Interface) -### Help Example +### Installation + ```shell +pip install commitlint +``` + +### Usage +``` $ commitlint --help usage: commitlint [-h] [-V] [--file FILE] [--hash HASH] [--from-hash FROM_HASH] [--to-hash TO_HASH] [--skip-detail] [commit_message] @@ -107,7 +113,7 @@ optional arguments: --skip-detail Skip the detailed error message check ``` -### Usage Examples +### Examples Check commit message directly: ```shell