From 2e5d6a8153756fe036c9eba54fbd7a6c87b157b8 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 12 Nov 2018 17:29:49 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/29602 Tested-by: build bot (Jenkins) Reviewed-by: Philipp Deppenwiese --- util/scripts/maintainers.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'util/scripts') 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() { -- cgit v1.2.3