Skip to content

Commit cc3ab48

Browse files
authored
Merge pull request #22 from vbatts/docs_for_exclude
README: doc the exclude function
2 parents 9c912af + 04d7733 commit cc3ab48

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ A way to do validation on git commits.
55

66
## install
77

8-
```bash
8+
```console
99
vbatts@valse ~ (master) $ go get -u github.com/vbatts/git-validation
1010
```
1111

1212
## usage
1313

1414
The flags
15-
```bash
15+
```console
1616
vbatts@valse ~/src/vb/git-validation (master *) $ git-validation -h
1717
Usage of git-validation:
1818
-D debug output
@@ -28,14 +28,14 @@ Usage of git-validation:
2828
```
2929

3030
The entire default rule set is run by default:
31-
```bash
31+
```console
3232
vbatts@valse ~/src/vb/git-validation (master) $ git-validation -list-rules
3333
"DCO" -- makes sure the commits are signed
3434
"short-subject" -- commit subjects are strictly less than 90 (github ellipsis length)
3535
```
3636

3737
Or, specify comma-delimited rules to run:
38-
```bash
38+
```console
3939
vbatts@valse ~/src/vb/git-validation (master) $ git-validation -run DCO,short-subject
4040
* b243ca4 "README: adding install and usage" ... PASS
4141
* d614ccf "*: run tests in a runner" ... PASS
@@ -47,7 +47,7 @@ vbatts@valse ~/src/vb/git-validation (master) $ git-validation -run DCO,short-su
4747
```
4848

4949
Verbosity shows each rule's output:
50-
```bash
50+
```console
5151
vbatts@valse ~/src/vb/git-validation (master) $ git-validation -v
5252
* d614ccf "*: run tests in a runner" ... PASS
5353
- PASS - has a valid DCO
@@ -70,7 +70,7 @@ vbatts@valse ~/src/vb/git-validation (master) $ git-validation -v
7070
```
7171

7272
Here's a failure:
73-
```bash
73+
```console
7474
vbatts@valse ~/src/vb/git-validation (master) $ git-validation
7575
* 49f51a8 "README: adding install and usage" ... FAIL
7676
- FAIL - does not have a valid DCO
@@ -85,6 +85,13 @@ vbatts@valse ~/src/vb/git-validation (master) $ echo $?
8585
1
8686
```
8787

88+
Excluding paths that are out of the scope of your project:
89+
```console
90+
vbatts@valse ~/src/vb/git-validation (master) $ GIT_CHECK_EXCLUDE="./vendor" git-validation -q -run dangling-whitespace
91+
...
92+
```
93+
using the `GIT_CHECK_EXCLUDE` environment variable
94+
8895
## Rules
8996

9097
Default rules are added by registering them to the `validate` package.

0 commit comments

Comments
 (0)