# This file is used to define class Configuration\r
#\r
# Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
#\r
\r
##\r
# Import Modules\r
#\r
+from __future__ import print_function\r
import Common.LongFilePathOs as os\r
import Common.EdkLogger as EdkLogger\r
from Common.DataType import *\r
"GeneralCheckIndentation":"GeneralCheckIndentation",\r
"GeneralCheckIndentationWidth":"GeneralCheckIndentationWidth",\r
"GeneralCheckLine":"GeneralCheckLine",\r
+ "GeneralCheckLineEnding":"GeneralCheckLineEnding",\r
"GeneralCheckLineWidth":"GeneralCheckLineWidth",\r
"GeneralCheckNoProgma":"GeneralCheckNoProgma",\r
"GeneralCheckNoTab":"GeneralCheckNoTab",\r
"GeneralCheckNo_Asm":"GeneralCheckNo_Asm",\r
"GeneralCheckNonAcsii":"GeneralCheckNonAcsii",\r
"GeneralCheckTabWidth":"GeneralCheckTabWidth",\r
+ "GeneralCheckTrailingWhiteSpaceLine":"GeneralCheckTrailingWhiteSpaceLine",\r
"GeneralCheckUni":"GeneralCheckUni",\r
"HeaderCheckAll":"HeaderCheckAll",\r
"HeaderCheckCFileCommentLicenseFormat":"HeaderCheckCFileCommentLicenseFormat",\r
"SmmCommParaCheckBufferType":"SmmCommParaCheckBufferType",\r
"SpaceCheckAll":"SpaceCheckAll",\r
"SpellingCheckAll":"SpellingCheckAll",\r
+ "TokenReleaceList":"TokenReleaceList",\r
"UniCheckAll":"UniCheckAll",\r
"UniCheckHelpInfo":"UniCheckHelpInfo",\r
"UniCheckPCDInfo":"UniCheckPCDInfo",\r
self.GeneralCheckNonAcsii = 1\r
# Check whether UNI file is valid\r
self.GeneralCheckUni = 1\r
+ # Check Only use CRLF (Carriage Return Line Feed) line endings.\r
+ self.GeneralCheckLineEnding = 1\r
+ # Check if there is no trailing white space in one line.\r
+ self.GeneralCheckTrailingWhiteSpaceLine = 1\r
+\r
+ self.CFunctionLayoutCheckNoDeprecated = 1\r
\r
## Space Checking\r
self.SpaceCheckAll = 1\r
self.HeaderCheckCFileCommentReferenceFormat = 1\r
# Check whether C File header Comment have the License immediately after the ""Copyright"" line\r
self.HeaderCheckCFileCommentLicenseFormat = 1\r
- \r
+\r
## C Function Layout Checking\r
self.CFunctionLayoutCheckAll = 0\r
\r
## Declarations and Data Types Checking\r
self.DeclarationDataTypeCheckAll = 0\r
\r
- # Check whether no use of int, unsigned, char, void, static, long in any .c, .h or .asl files.\r
+ # Check whether no use of int, unsigned, char, void, long in any .c, .h or .asl files.\r
self.DeclarationDataTypeCheckNoUseCType = 1\r
# Check whether the modifiers IN, OUT, OPTIONAL, and UNALIGNED are used only to qualify arguments to a function and should not appear in a data type declaration\r
self.DeclarationDataTypeCheckInOutModifier = 1\r
self.MetaDataFileCheckModuleFilePpiFormat = 1\r
# Check Pcd Format in INF files\r
self.MetaDataFileCheckModuleFilePcdFormat = 1\r
- \r
+\r
# Check UNI file\r
self.UniCheckAll = 0\r
# Check INF or DEC file whether defined the localized information in the associated UNI file.\r
\r
# The directory listed here will not be parsed, split with ','\r
self.SkipDirList = []\r
- \r
+\r
# The file listed here will not be parsed, split with ','\r
self.SkipFileList = []\r
\r
# A list for binary file ext name\r
self.BinaryExtList = []\r
- \r
+\r
# A list for only scanned folders\r
self.ScanOnlyDirList = []\r
- \r
+\r
# A list for Copyright format\r
self.Copyright = []\r
\r
+ self.TokenReleaceList = []\r
+\r
self.ParseConfig()\r
\r
def ParseConfig(self):\r
List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
if List[0] == 'Copyright':\r
List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
+ if List[0] == 'TokenReleaceList':\r
+ List[1] = GetSplitValueList(List[1], TAB_COMMA_SPLIT)\r
self.__dict__[_ConfigFileToInternalTranslation[List[0]]] = List[1]\r
\r
def ShowMe(self):\r
- print self.Filename\r
+ print(self.Filename)\r
for Key in self.__dict__.keys():\r
- print Key, '=', self.__dict__[Key]\r
+ print(Key, '=', self.__dict__[Key])\r
\r
#\r
# test that our dict and out class still match in contents.\r