@@ -461,25 +461,30 @@ func (c *Context) Validate() []error {
461
461
if val , ok := people [person .GitHub ]; ok {
462
462
// non-emeritus must have email and company set
463
463
if prefix != "emeritus_lead" {
464
- // email must be set and consistent
465
- if val .Email == "" {
466
- errors = append (errors , fmt .Errorf ("%s: %s: email is empty but should be set" , group .Dir , val .GitHub ))
467
- } else if val .Email != person .Email {
464
+ // email and company must match across groups
465
+ if val .Email != person .Email {
468
466
errors = append (errors , fmt .Errorf ("%s: %s email: %q does not match other entries %q" , group .Dir , val .GitHub , val .Email , person .Email ))
469
467
}
470
- // company must be set and consistent
471
- if val .Company == "" {
472
- errors = append (errors , fmt .Errorf ("%s: %s: company is empty but should be set" , group .Dir , val .Company ))
473
- } else if val .Company != person .Company {
468
+ if val .Company != person .Company {
474
469
errors = append (errors , fmt .Errorf ("%s: %s company: %q does not match other entries %q" , group .Dir , val .GitHub , val .Company , person .Company ))
475
470
}
476
471
}
477
- // all entries should have github + name, emeritus or not
472
+ // all entries should have matching github + name, emeritus or not
478
473
if val .Name != person .Name {
479
474
errors = append (errors , fmt .Errorf ("%s: %s: expected person: %v, got: %v" , group .Dir , prefix , val , person ))
480
475
}
481
476
} else if prefix != "emeritus_lead" {
482
477
people [person .GitHub ] = person
478
+ // email and company must be set for leads
479
+ if person .Email == "" {
480
+ errors = append (errors , fmt .Errorf ("%s: %s: email is empty but should be set" , group .Dir , person .GitHub ))
481
+ }
482
+ if person .Company == "" {
483
+ errors = append (errors , fmt .Errorf ("%s: %s: company is empty but should be set" , group .Dir , person .GitHub ))
484
+ }
485
+ }
486
+ if person .Name == "" {
487
+ errors = append (errors , fmt .Errorf ("%s: %s: name is empty but should be set" , group .Dir , person .GitHub ))
483
488
}
484
489
485
490
if prefix == "emeritus_lead" && person .Company != "" {
0 commit comments