diff options
author | Pierre Gondois <pierre.gondois@arm.com> | 2020-07-01 22:06:00 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-07-02 09:29:38 +0000 |
commit | 01356d2963fcd9ff90166674d054e17d265e0a5f (patch) | |
tree | 00f9af74bca5f956098ee5c99b91c745d819f6a0 /BaseTools/Scripts | |
parent | c8edb70945099fd35a0997d3f3db105efc144e13 (diff) | |
download | edk2-01356d2963fcd9ff90166674d054e17d265e0a5f.tar.gz edk2-01356d2963fcd9ff90166674d054e17d265e0a5f.tar.bz2 edk2-01356d2963fcd9ff90166674d054e17d265e0a5f.zip |
BaseTools: PatchCheck: Exclude bash scripts from CRLF check
Bash scripts require LF line endings to work.
PatchCheck.py checks that the files added in a patch have CRLF
line endings. It excludes files ending with the ".sh" extension
from this check.
Some bash script don't have a ".sh" extension. Most of them are
located in:
- BaseTools/BinWrappers/PosixLike/
- BaseTools/Bin/CYGWIN_NT-5.1-i686/
This patch excludes these folder plus BaseTools/BuildEnv from
this CRLF check.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-x | BaseTools/Scripts/PatchCheck.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 106b434c75..e38cf61f93 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -3,6 +3,7 @@ #
# Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
# Copyright (C) 2020, Red Hat, Inc.<BR>
+# Copyright (c) 2020, ARM Ltd. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -384,9 +385,14 @@ class GitDiffCheck: self.is_newfile = False
self.force_crlf = True
self.force_notabs = True
- if self.filename.endswith('.sh'):
+ if self.filename.endswith('.sh') or \
+ self.filename.startswith('BaseTools/BinWrappers/PosixLike/') or \
+ self.filename.startswith('BaseTools/Bin/CYGWIN_NT-5.1-i686/') or \
+ self.filename == 'BaseTools/BuildEnv':
#
# Do not enforce CR/LF line endings for linux shell scripts.
+ # Some linux shell scripts don't end with the ".sh" extension,
+ # they are identified by their path.
#
self.force_crlf = False
if self.filename == '.gitmodules':
|