Skip to content

Commit 24b76f2

Browse files
committed
fixed singleton-comparison pylint warnings
1 parent cf0b4e1 commit 24b76f2

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

addons/cppcheckdata.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -978,22 +978,22 @@ def __repr__(self):
978978
def isMatch(self, file, line, message, errorId):
979979
# Line Suppression
980980
if ((self.fileName is None or fnmatch(file, self.fileName))
981-
and (self.suppressionType == None) # Verify use of default suppression type (None = unique)
982-
and (self.lineNumber != None and int(line) == int(self.lineNumber))
981+
and (self.suppressionType is None) # Verify use of default suppression type (None = unique)
982+
and (self.lineNumber is not None and int(line) == int(self.lineNumber))
983983
and (self.symbolName is None or fnmatch(message, '*'+self.symbolName+'*'))
984984
and fnmatch(errorId, self.errorId)):
985985
return True
986986
# File Suppression
987987
if ((self.fileName is None or fnmatch(file, self.fileName))
988-
and (self.suppressionType != None and self.suppressionType == "file") # Verify use of file (global) suppression type
988+
and (self.suppressionType is not None and self.suppressionType == "file") # Verify use of file (global) suppression type
989989
and (self.symbolName is None or fnmatch(message, '*'+self.symbolName+'*'))
990990
and fnmatch(errorId, self.errorId)):
991991
return True
992992
# Block Suppression Mode
993993
if ((self.fileName is None or fnmatch(file, self.fileName))
994-
and (self.suppressionType != None and self.suppressionType == "block") # Type for Block suppression
995-
and (self.lineBegin != None and int(line) > int(self.lineBegin)) # Code Match is between the Block suppression
996-
and (self.lineEnd != None and int(line) < int(self.lineEnd)) # Code Match is between the Block suppression
994+
and (self.suppressionType is not None and self.suppressionType == "block") # Type for Block suppression
995+
and (self.lineBegin is not None and int(line) > int(self.lineBegin)) # Code Match is between the Block suppression
996+
and (self.lineEnd is not None and int(line) < int(self.lineEnd)) # Code Match is between the Block suppression
997997
and (self.symbolName is None or fnmatch(message, '*'+self.symbolName+'*'))
998998
and fnmatch(errorId, self.errorId)):
999999
return True

addons/misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
VERIFY_ACTUAL = []
1717

1818
def reportError(token, severity, msg, id):
19-
if id == 'debug' and DEBUG == False:
19+
if id == 'debug' and not DEBUG:
2020
return
2121
if VERIFY:
2222
VERIFY_ACTUAL.append(str(token.linenr) + ':' + id)

addons/namingng.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def report_pending_ifndef(directive,column):
242242
phase = -1
243243
continue
244244
guard_name,guard_column = check_include_guard_name(conf,directive)
245-
if guard_name == None:
245+
if guard_name is None:
246246
phase = -1
247247
continue
248248
pending_ifndef = directive

0 commit comments

Comments
 (0)