Skip to content

Commit

Permalink
Merge pull request #16390 from justinsb/update_boilerplate_py
Browse files Browse the repository at this point in the history
chore: update boilerplate.py to recognize new build tags
  • Loading branch information
k8s-ci-robot committed Feb 28, 2024
2 parents 2e72309 + 700974a commit 68c500c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hack/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,20 +213,23 @@ def get_dates():
def get_regexs():
regexs = {}
# Search for "YEAR" which exists in the boilerplate, but shouldn't in the real thing
regexs["year"] = re.compile('YEAR')
# get_dates return 2014, 2015, 2016, 2017, or 2018 until the current year as a regex like: "(2014|2015|2016|2017|2018)";
regexs["year"] = re.compile("YEAR")
# 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
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(
r"^(//go:build.*\n// \+build.*\n)+\n", re.MULTILINE)
r"^(//(go:build| \+build).*\n)+\n", re.MULTILINE
)
# strip #!.* from scripts
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
# Search for generated files
regexs["generated"] = re.compile('DO NOT EDIT')
regexs["generated"] = re.compile(r"^[/*#]+ +.* DO NOT EDIT\.$", re.MULTILINE)
return regexs


def main():
regexs = get_regexs()
refs = get_refs()
Expand Down

0 comments on commit 68c500c

Please sign in to comment.