ci: core_checker: Match copyright line with regex

Allow for a variety of copyright dates by matching copyright statements
with a regex.
This commit is contained in:
Paul Bartell 2022-08-12 17:44:44 -07:00 committed by Paul Bartell
parent 8f21b61908
commit 0048a568c9
2 changed files with 12 additions and 2 deletions

View file

@ -320,12 +320,14 @@ FREERTOS_HEADER = [
' */\n',
]
FREERTOS_COPYRIGHT_REGEX = r"^( *(\/\*|\*|#|\/\/))? Copyright \(C\) 20\d\d Amazon.com, Inc. or its affiliates. All Rights Reserved\.( \*\/)?$"
def main():
parser = HeaderChecker.configArgParser()
args = parser.parse_args()
# Configure the checks then run
checker = HeaderChecker(FREERTOS_HEADER)
checker = HeaderChecker(FREERTOS_HEADER, copyright_regex=FREERTOS_COPYRIGHT_REGEX)
checker.ignoreExtension(*FREERTOS_IGNORED_EXTENSIONS)
checker.ignorePattern(*FREERTOS_IGNORED_PATTERNS)
checker.ignoreFile(*FREERTOS_IGNORED_FILES)