|
1 | 1 | #!/usr/bin/env python3
|
| 2 | +#/* |
| 3 | +# * FreeRTOS Kernel V10.4.4 |
| 4 | +# * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 5 | +# * |
| 6 | +# * SPDX-License-Identifier: MIT |
| 7 | +# * |
| 8 | +# * Permission is hereby granted, free of charge, to any person obtaining a copy of |
| 9 | +# * this software and associated documentation files (the "Software"), to deal in |
| 10 | +# * the Software without restriction, including without limitation the rights to |
| 11 | +# * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
| 12 | +# * the Software, and to permit persons to whom the Software is furnished to do so, |
| 13 | +# * subject to the following conditions: |
| 14 | +# * |
| 15 | +# * The above copyright notice and this permission notice shall be included in all |
| 16 | +# * copies or substantial portions of the Software. |
| 17 | +# * |
| 18 | +# * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 19 | +# * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
| 20 | +# * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 21 | +# * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
| 22 | +# * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 23 | +# * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 24 | +# * |
| 25 | +# * https://www.FreeRTOS.org |
| 26 | +# * https://github.com/FreeRTOS |
| 27 | +# * |
| 28 | +# */ |
2 | 29 |
|
3 | 30 | import os
|
4 | 31 | from common.header_checker import HeaderChecker
|
|
7 | 34 | # CONFIG
|
8 | 35 | #--------------------------------------------------------------------------------------------------
|
9 | 36 | KERNEL_IGNORED_FILES = [
|
10 |
| - 'FreeRTOS-openocd.c' |
| 37 | + 'FreeRTOS-openocd.c', |
| 38 | + 'Makefile', |
| 39 | + '.DS_Store' |
11 | 40 | ]
|
12 | 41 |
|
13 | 42 | KERNEL_IGNORED_EXTENSIONS = [
|
|
34 | 63 | '.txt'
|
35 | 64 | ]
|
36 | 65 |
|
| 66 | +KERNEL_ASM_EXTENSIONS = [ |
| 67 | + '.s', |
| 68 | + '.S', |
| 69 | + '.src', |
| 70 | + '.inc', |
| 71 | + '.s26', |
| 72 | + '.s43', |
| 73 | + '.s79', |
| 74 | + '.s85', |
| 75 | + '.s87', |
| 76 | + '.s90', |
| 77 | + '.asm', |
| 78 | + '.h' |
| 79 | +] |
| 80 | + |
| 81 | +KERNEL_PY_EXTENSIONS = [ |
| 82 | + '.py' |
| 83 | +] |
| 84 | + |
37 | 85 | KERNEL_IGNORED_PATTERNS = [
|
38 | 86 | r'.*\.git.*',
|
| 87 | + r'.*portable/IAR/AtmelSAM7S64/.*AT91SAM7.*', |
| 88 | + r'.*portable/GCC/ARM7_AT91SAM7S/.*', |
| 89 | + r'.*portable/MPLAB/PIC18F/stdio.h' |
| 90 | +] |
| 91 | + |
| 92 | +KERNEL_THIRD_PARTY_PATTERNS = [ |
39 | 93 | r'.*portable/ThirdParty/GCC/Posix/port*',
|
40 |
| - r'.*portable.*Xtensa_ESP32\/include\/portmacro\.h', |
41 |
| - r'.*portable.*Xtensa_ESP32.*port\.c', |
42 |
| - r'.*portable.*Xtensa_ESP32.*portasm\.S', |
43 |
| - r'.*portable.*Xtensa_ESP32.*xtensa_.*', |
44 |
| - r'.*portable.*Xtensa_ESP32.*portmux_impl.*', |
45 |
| - r'.*portable.*Xtensa_ESP32.*xt_asm_utils\.h' |
| 94 | + r'.*portable/ThirdParty/*', |
| 95 | + r'.*portable/IAR/AVR32_UC3/.*', |
| 96 | + r'.*portable/GCC/AVR32_UC3/.*', |
46 | 97 | ]
|
47 | 98 |
|
48 | 99 | KERNEL_HEADER = [
|
49 | 100 | '/*\n',
|
50 |
| - ' * FreeRTOS Kernel V10.4.3\n', |
51 |
| - ' * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n', |
| 101 | + ' * FreeRTOS Kernel V10.4.4\n', |
| 102 | + ' * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n', |
| 103 | + ' *\n', |
| 104 | + ' * SPDX-License-Identifier: MIT\n', |
52 | 105 | ' *\n',
|
53 | 106 | ' * Permission is hereby granted, free of charge, to any person obtaining a copy of\n',
|
54 | 107 | ' * this software and associated documentation files (the "Software"), to deal in\n',
|
|
73 | 126 | ' */\n',
|
74 | 127 | ]
|
75 | 128 |
|
76 |
| - |
77 | 129 | def main():
|
78 | 130 | parser = HeaderChecker.configArgParser()
|
79 | 131 | args = parser.parse_args()
|
80 | 132 |
|
81 | 133 | # Configure the checks then run
|
82 |
| - checker = HeaderChecker(KERNEL_HEADER) |
83 |
| - checker.ignoreExtension(*KERNEL_IGNORED_EXTENSIONS) |
84 |
| - checker.ignorePattern(*KERNEL_IGNORED_PATTERNS) |
85 |
| - checker.ignoreFile(*KERNEL_IGNORED_FILES) |
| 134 | + checker = HeaderChecker(KERNEL_HEADER, |
| 135 | + ignored_files=KERNEL_IGNORED_FILES, |
| 136 | + ignored_ext=KERNEL_IGNORED_EXTENSIONS, |
| 137 | + ignored_patterns=KERNEL_IGNORED_PATTERNS, |
| 138 | + third_party_patterns=KERNEL_THIRD_PARTY_PATTERNS, |
| 139 | + py_ext=KERNEL_PY_EXTENSIONS, |
| 140 | + asm_ext=KERNEL_ASM_EXTENSIONS) |
86 | 141 | checker.ignoreFile(os.path.split(__file__)[-1])
|
87 | 142 |
|
88 | 143 | rc = checker.processArgs(args)
|
|
0 commit comments