mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
hack/boilerplate: Tolerate new build tag format (//go:build
)
Signed-off-by: Stephen Augustus <foo@auggie.dev>
This commit is contained in:
parent
481cf6fbe7
commit
f11a3cd58f
@ -216,9 +216,11 @@ def get_regexs():
|
|||||||
# get_dates return 2014, 2015, 2016, 2017, or 2018 until the current year as a regex like: "(2014|2015|2016|2017|2018)";
|
# get_dates return 2014, 2015, 2016, 2017, or 2018 until the current year as a regex like: "(2014|2015|2016|2017|2018)";
|
||||||
# company holder names can be anything
|
# company holder names can be anything
|
||||||
regexs["date"] = re.compile(get_dates())
|
regexs["date"] = re.compile(get_dates())
|
||||||
# strip // +build \n\n build constraints
|
# strip the following build constraints/tags:
|
||||||
|
# //go:build
|
||||||
|
# // +build \n\n
|
||||||
regexs["go_build_constraints"] = re.compile(
|
regexs["go_build_constraints"] = re.compile(
|
||||||
r"^(// \+build.*\n)+\n", re.MULTILINE)
|
r"^(//(go:build| \+build).*\n)+\n", re.MULTILINE)
|
||||||
# strip #!.* from scripts
|
# strip #!.* from scripts
|
||||||
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
|
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
|
||||||
# Search for generated files
|
# Search for generated files
|
||||||
|
Loading…
Reference in New Issue
Block a user