Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(issue-4): improve help of --strict #13

Merged
merged 1 commit into from
Jan 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ askama = "0.8"
chrono = "0.4.9"
log = "0.4.8"
stderrlog = "0.4.3"
lazy_static = "1.4.0"

[dependencies.git2]
version = "0.10"
Expand Down
14 changes: 9 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use semver::Version;
use simple_error::SimpleError;
use structopt::StructOpt;
use log::{warn, error};
use lazy_static::lazy_static;

use crate::bumping::{Bump, BumpType};
use crate::changelog::ChangeLog;
Expand All @@ -14,6 +15,13 @@ mod bumping;
mod repo;
mod changelog;

lazy_static! {
static ref STRICT_HELP: String = format!(r#"Quit with an error if non-conventional commit messages are found.

Default behaviour is to simply print a warning. Conventional messages start with
one of the following types: {}."#, bumping::OTHER_TYPES.join(", "));
}

/// Detect version bump based on Conventional Commits
///
/// what-bump analyses your commit history, written according to the Conventional Commits specification
Expand Down Expand Up @@ -56,11 +64,7 @@ struct Config {
#[structopt(long, short)]
overwrite: bool,

/// Quit with an error if non-conventional commit messages are found.
///
/// Default behaviour is to simply print a warning. Allowed values are those recommended
/// by https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional.
#[structopt(long)]
#[structopt(long, help = &STRICT_HELP)]
strict: bool,

/// Verbose mode (-v, -vv, -vvv, etc)
Expand Down