()
| 10 | ) |
| 11 | |
| 12 | func main() { |
| 13 | var start, end string |
| 14 | flag.StringVar(&start, "start", "master", "The start of the revision range for analysis") |
| 15 | flag.StringVar(&end, "end", "HEAD", "The end of the revision range for analysis") |
| 16 | flag.Parse() |
| 17 | |
| 18 | commits, err := util.CommitsBetween(start, end) |
| 19 | if err != nil { |
| 20 | if err == util.ErrNotCommit { |
| 21 | fmt.Fprintf(os.Stderr, "WARNING: one of the provided commits does not exist, not a true branch\n") |
| 22 | os.Exit(0) |
| 23 | } |
| 24 | fmt.Fprintf(os.Stderr, "ERROR: couldn't find commits from %s..%s: %v\n", start, end, err) |
| 25 | os.Exit(1) |
| 26 | } |
| 27 | |
| 28 | // TODO: Filter out bump commits for now until we decide how to deal with |
| 29 | // them correctly. |
| 30 | // TODO: ...along with subtree merges. |
| 31 | nonbumpCommits := []util.Commit{} |
| 32 | for _, commit := range commits { |
| 33 | if !strings.HasPrefix(commit.Summary, "bump") { |
| 34 | nonbumpCommits = append(nonbumpCommits, commit) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | errs := []string{} |
| 39 | for _, validate := range AllValidators { |
| 40 | if err := validate(nonbumpCommits); err != nil { |
| 41 | errs = append(errs, err.Error()) |
| 42 | } |
| 43 | } |
| 44 | if len(os.Getenv("RESTORE_AND_VERIFY_GODEPS")) > 0 { |
| 45 | // Godeps verifies all commits, including bumps and UPSTREAM |
| 46 | if err := ValidateGodeps(commits); err != nil { |
| 47 | errs = append(errs, err.Error()) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | if len(errs) > 0 { |
| 52 | fmt.Fprintf(os.Stderr, "%s\n", strings.Join(errs, "\n\n")) |
| 53 | os.Exit(2) |
| 54 | } |
| 55 | } |
nothing calls this directly
no test coverage detected