From 04d77338854285cdde610154e77597de3581e2df Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 27 Apr 2017 10:29:28 -0400 Subject: [PATCH] README: doc the exclude function https://github.com/vbatts/git-validation/pull/21 Signed-off-by: Vincent Batts --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index cdacd5b..6ecab1d 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ A way to do validation on git commits. ## install -```bash +```console vbatts@valse ~ (master) $ go get -u github.com/vbatts/git-validation ``` ## usage The flags -```bash +```console vbatts@valse ~/src/vb/git-validation (master *) $ git-validation -h Usage of git-validation: -D debug output @@ -28,14 +28,14 @@ Usage of git-validation: ``` The entire default rule set is run by default: -```bash +```console vbatts@valse ~/src/vb/git-validation (master) $ git-validation -list-rules "DCO" -- makes sure the commits are signed "short-subject" -- commit subjects are strictly less than 90 (github ellipsis length) ``` Or, specify comma-delimited rules to run: -```bash +```console vbatts@valse ~/src/vb/git-validation (master) $ git-validation -run DCO,short-subject * b243ca4 "README: adding install and usage" ... PASS * d614ccf "*: run tests in a runner" ... PASS @@ -47,7 +47,7 @@ vbatts@valse ~/src/vb/git-validation (master) $ git-validation -run DCO,short-su ``` Verbosity shows each rule's output: -```bash +```console vbatts@valse ~/src/vb/git-validation (master) $ git-validation -v * d614ccf "*: run tests in a runner" ... PASS - PASS - has a valid DCO @@ -70,7 +70,7 @@ vbatts@valse ~/src/vb/git-validation (master) $ git-validation -v ``` Here's a failure: -```bash +```console vbatts@valse ~/src/vb/git-validation (master) $ git-validation * 49f51a8 "README: adding install and usage" ... FAIL - FAIL - does not have a valid DCO @@ -85,6 +85,13 @@ vbatts@valse ~/src/vb/git-validation (master) $ echo $? 1 ``` +Excluding paths that are out of the scope of your project: +```console +vbatts@valse ~/src/vb/git-validation (master) $ GIT_CHECK_EXCLUDE="./vendor" git-validation -q -run dangling-whitespace +... +``` +using the `GIT_CHECK_EXCLUDE` environment variable + ## Rules Default rules are added by registering them to the `validate` package.