diff options
author | Patrick Georgi <pgeorgi@google.com> | 2018-11-12 17:29:49 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2018-11-13 17:43:28 +0000 |
commit | 2e5d6a8153756fe036c9eba54fbd7a6c87b157b8 (patch) | |
tree | ac0b26b3babd04cfaf114cbb8ac3789a9ec17f5f | |
parent | cca1f371d2c1f775fce69e526a20bd424a4aecb8 (diff) | |
download | coreboot-2e5d6a8153756fe036c9eba54fbd7a6c87b157b8.tar.xz |
util/scrips/maintainers.go: Allow file to appear in multiple components
Without this change, the tool only reports the first hit. We want to see
all of them.
Change-Id: Ib59b13c50b61c48e3cb200bf57e28c9453590819
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/29602
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
-rw-r--r-- | util/scripts/maintainers.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/util/scripts/maintainers.go b/util/scripts/maintainers.go index a45758147d..0474b77f90 100644 --- a/util/scripts/maintainers.go +++ b/util/scripts/maintainers.go @@ -177,6 +177,8 @@ func match_file(fname string, files []string) (bool, error) { } func find_maintainer(fname string) { + var success bool + for _, subsystem := range subsystems { matched, err := match_file(fname, subsystem.file) if err != nil { @@ -184,16 +186,20 @@ func find_maintainer(fname string) { return } if matched && subsystem.name != "THE REST" { + success = true fmt.Println(fname, "is in subsystem", subsystem.name) fmt.Println("Maintainers: ", subsystem.maintainer) - return } } - fmt.Println(fname, "has no subsystem defined in MAINTAINERS") + if !success { + fmt.Println(fname, "has no subsystem defined in MAINTAINERS") + } } func find_unmaintained(fname string) { + var success bool + for _, subsystem := range subsystems { matched, err := match_file(fname, subsystem.file) if err != nil { @@ -201,12 +207,14 @@ func find_unmaintained(fname string) { return } if matched && subsystem.name != "THE REST" { + success = true fmt.Println(fname, "is in subsystem", subsystem.name) - return } } - fmt.Println(fname, "has no subsystem defined in MAINTAINERS") + if !success { + fmt.Println(fname, "has no subsystem defined in MAINTAINERS") + } } func main() { |