pylintrc_travis: Enable more messages and fix issues (#2332)

The plan is to enable more and more useful messages and fix the issues
step by step to improve the code quality.
This commit is contained in:
Sebastian 2019-11-05 21:05:43 +01:00 committed by amai2012
parent 6c9c723850
commit 0a38b1b511
3 changed files with 12 additions and 6 deletions

View File

@ -160,7 +160,7 @@ def exp42(data):
def exp15(data):
for scope in data.scopes:
if scope.type in ('If', 'For', 'While'):
token = scope.bodyStart.next
token = scope.bodyStart.next
if token.str==';' and token.linenr==scope.bodyStart.linenr:
reportError(token, 'style', 'Do not place a semicolon on the same line as an IF, FOR or WHILE', 'EXP15-C')
@ -232,7 +232,7 @@ def int31(data, platform):
'style',
'Ensure that integer conversions do not result in lost or misinterpreted data (casting ' + str(value.intvalue) + ' to ' + destType + ')',
'INT31-c')
break
break
# MSC24-C
# Do not use deprecated or obsolescent functions
def msc24(data):
@ -321,7 +321,7 @@ def str11(data):
if not parent.isAssignmentOp:
continue
varToken = parentOp1.astOperand1
if varToken is None or not varToken.isName:
continue
@ -332,7 +332,7 @@ def str11(data):
valueToken = parentOp1.astOperand2
if valueToken is None:
continue
if valueToken.isNumber and int(valueToken.str)==strlen:
reportError(valueToken, 'style', 'Do not specify the bound of a character array initialized with a string literal', 'STR11-C')

View File

@ -1,6 +1,11 @@
# Just the severe stuff...
[MESSAGES CONTROL]
disable=C,R,W
enable=mixed-indentation,
trailing-whitespace,
print-statement,
literal-comparison,
#unnecessary-semicolon,
#bad-indentation
[REPORTS]
reports=no
[TYPECHECK]
@ -8,3 +13,4 @@ reports=no
ignored-classes=SQLObject,_socketobject
[MASTER]
init-hook='import sys; sys.path.append("./addons")'
suggestion-mode=yes

View File

@ -119,7 +119,7 @@ if __name__ == "__main__":
else:
who = 'Your'
crashes.append(package + ' ' + who)
with open(result_file, 'a') as myfile:
myfile.write(package + '\n')
diff = lib.diff_results(work_path, 'master', results_to_diff[0], 'your', results_to_diff[1])