mirror of
https://github.com/FreeRTOS/FreeRTOS.git
synced 2025-06-23 09:27:46 +08:00
Fix issues in CI check for header files with directories and .gitmodules (#420)
This commit is contained in:
8
.github/scripts/check-header.py
vendored
8
.github/scripts/check-header.py
vendored
@ -43,6 +43,11 @@ class HeaderChecker:
|
|||||||
if self.isIgnoredFile(path):
|
if self.isIgnoredFile(path):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# Skip if entry is a directory.
|
||||||
|
if os.path.isdir(path):
|
||||||
|
print('Skipping valid file check on directory path: %s' % path)
|
||||||
|
return True
|
||||||
|
|
||||||
# Don't need entire file. Read sufficienly large chunk of file that should contain the header
|
# Don't need entire file. Read sufficienly large chunk of file that should contain the header
|
||||||
with open(path, encoding='utf-8', errors='ignore') as file:
|
with open(path, encoding='utf-8', errors='ignore') as file:
|
||||||
chunk = file.read(len(''.join(self.header)) + self.padding)
|
chunk = file.read(len(''.join(self.header)) + self.padding)
|
||||||
@ -164,7 +169,8 @@ def main():
|
|||||||
checker.ignoreExtension('.vcxproj',
|
checker.ignoreExtension('.vcxproj',
|
||||||
'.vcxproj.filters',
|
'.vcxproj.filters',
|
||||||
'.sln'
|
'.sln'
|
||||||
'.md')
|
'.md,'
|
||||||
|
'.gitmodules')
|
||||||
|
|
||||||
checker.ignoreFile(os.path.split(__file__)[-1], # Add self
|
checker.ignoreFile(os.path.split(__file__)[-1], # Add self
|
||||||
'mbedtls_config.h')
|
'mbedtls_config.h')
|
||||||
|
Reference in New Issue
Block a user