Only check specified paths in check-authors.go

This commit is contained in:
Jakob Borg 2016-03-01 18:11:06 +01:00
parent 8b045a826a
commit ea5808d833

View File

@ -42,7 +42,7 @@ func init() {
} }
func main() { func main() {
actual := actualAuthorEmails() actual := actualAuthorEmails("cmd/", "lib/", "gui/", "test/", "script/")
listed := listedAuthorEmails() listed := listedAuthorEmails()
missing := actual.except(listed) missing := actual.except(listed)
if len(missing) > 0 { if len(missing) > 0 {
@ -56,8 +56,9 @@ func main() {
// actualAuthorEmails returns the set of author emails found in the actual git // actualAuthorEmails returns the set of author emails found in the actual git
// commit log, except those in excluded commits. // commit log, except those in excluded commits.
func actualAuthorEmails() stringSet { func actualAuthorEmails(paths ...string) stringSet {
cmd := exec.Command("git", "log", "--format=%H %ae") args := append([]string{"log", "--format=%H %ae"}, paths...)
cmd := exec.Command("git", args...)
bs, err := cmd.Output() bs, err := cmd.Output()
if err != nil { if err != nil {
log.Fatal("authorEmails:", err) log.Fatal("authorEmails:", err)