From 589e4076dd5067ab41f99f3f6ee08de928bc2660 Mon Sep 17 00:00:00 2001 From: foo0x29a Date: Tue, 26 Jun 2018 04:22:08 -0300 Subject: [PATCH] Pick the first extension matched --- hack/boilerplate/boilerplate.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index d952d4af50a..d90abd44a78 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -93,13 +93,11 @@ def file_passes(filename, refs, regexs): else: ref = refs[basename] - # remove build tags from the top of Go files - if extension == "go" or extension =="generatego": + # remove extra content from the top of files + if extension == "go" or extension == "generatego": p = regexs["go_build_constraints"] (data, found) = p.subn("", data, 1) - - # remove shebang from the top of shell files - if extension == "sh": + elif extension == "sh": p = regexs["shebang"] (data, found) = p.subn("", data, 1)