Add in the copyright header regex for the year

This commit is contained in:
Soren Ptak 2024-02-26 10:48:06 -05:00
parent 2fcb0f48b1
commit 27a2ca9cd3

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
#/* #/*
# * FreeRTOS Kernel <DEVELOPMENT BRANCH> # * FreeRTOS Kernel <DEVELOPMENT BRANCH>
# * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # * Copyright (C) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# * # *
# * SPDX-License-Identifier: MIT # * SPDX-License-Identifier: MIT
# * # *
@ -108,7 +108,7 @@ KERNEL_THIRD_PARTY_PATTERNS = [
KERNEL_HEADER = [ KERNEL_HEADER = [
'/*\n', '/*\n',
' * FreeRTOS Kernel <DEVELOPMENT BRANCH>\n', ' * FreeRTOS Kernel <DEVELOPMENT BRANCH>\n',
' * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n', ' * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n',
' *\n', ' *\n',
' * SPDX-License-Identifier: MIT\n', ' * SPDX-License-Identifier: MIT\n',
' *\n', ' *\n',
@ -135,12 +135,16 @@ KERNEL_HEADER = [
' */\n', ' */\n',
] ]
FREERTOS_COPYRIGHT_REGEX = r"^( *(\/\*|\*|#|\/\/))? Copyright \(C\) 20\d\d Amazon.com, Inc. or its affiliates. All Rights Reserved\.( \*\/)?$"
def main(): def main():
parser = HeaderChecker.configArgParser() parser = HeaderChecker.configArgParser()
args = parser.parse_args() args = parser.parse_args()
# Configure the checks then run # Configure the checks then run
checker = HeaderChecker(KERNEL_HEADER, checker = HeaderChecker(KERNEL_HEADER,
copyright_regex=FREERTOS_COPYRIGHT_REGEX,
ignored_files=KERNEL_IGNORED_FILES, ignored_files=KERNEL_IGNORED_FILES,
ignored_ext=KERNEL_IGNORED_EXTENSIONS, ignored_ext=KERNEL_IGNORED_EXTENSIONS,
ignored_patterns=KERNEL_IGNORED_PATTERNS, ignored_patterns=KERNEL_IGNORED_PATTERNS,