mirror of
https://github.com/vbatts/git-validation.git
synced 2024-12-28 08:16:31 +00:00
Merge pull request #13 from wking/explicit-range-implies-no-travis
main: Explicit -range implies -no-travis
This commit is contained in:
commit
3fd57e3bf5
1 changed files with 8 additions and 6 deletions
4
main.go
4
main.go
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
var (
|
||||
flCommitRange = flag.String("range", "", "use this commit range instead")
|
||||
flCommitRange = flag.String("range", "", "use this commit range instead (implies -no-travis)")
|
||||
flListRules = flag.Bool("list-rules", false, "list the rules registered")
|
||||
flRun = flag.String("run", "", "comma delimited list of rules to run. Defaults to all.")
|
||||
flVerbose = flag.Bool("v", false, "verbose")
|
||||
|
@ -48,6 +48,7 @@ func main() {
|
|||
}
|
||||
|
||||
var commitRange = *flCommitRange
|
||||
if commitRange == "" {
|
||||
if strings.ToLower(os.Getenv("TRAVIS")) == "true" && !*flNoTravis {
|
||||
if os.Getenv("TRAVIS_COMMIT_RANGE") != "" {
|
||||
commitRange = os.Getenv("TRAVIS_COMMIT_RANGE")
|
||||
|
@ -55,6 +56,7 @@ func main() {
|
|||
commitRange = os.Getenv("TRAVIS_COMMIT")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
runner, err := validate.NewRunner(*flDir, rules, commitRange, *flVerbose)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue