From aad429ba09966f0947095bf091325dc9833101a6 Mon Sep 17 00:00:00 2001 From: Archit Aggarwal Date: Mon, 23 Nov 2020 13:08:15 -0800 Subject: [PATCH] Fix issues in CI check for header files with directories and .gitmodules (#420) --- .github/scripts/check-header.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/scripts/check-header.py b/.github/scripts/check-header.py index d13537c5a2..ce6de55346 100755 --- a/.github/scripts/check-header.py +++ b/.github/scripts/check-header.py @@ -43,6 +43,11 @@ class HeaderChecker: if self.isIgnoredFile(path): 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 with open(path, encoding='utf-8', errors='ignore') as file: chunk = file.read(len(''.join(self.header)) + self.padding) @@ -164,7 +169,8 @@ def main(): checker.ignoreExtension('.vcxproj', '.vcxproj.filters', '.sln' - '.md') + '.md,' + '.gitmodules') checker.ignoreFile(os.path.split(__file__)[-1], # Add self 'mbedtls_config.h')