pylintrc_travis: Enable more checks, fix anomalous-backslash-in-string issues (#2334)

This commit is contained in:
Sebastian 2019-11-06 17:49:37 +01:00 committed by GitHub
parent 2ce6167894
commit 828a3fda1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -484,7 +484,7 @@ def isHexEscapeSequence(symbols):
def isOctalEscapeSequence(symbols): def isOctalEscapeSequence(symbols):
"""Checks that given symbols are valid octal escape sequence: r"""Checks that given symbols are valid octal escape sequence:
octal-escape-sequence: octal-escape-sequence:
\ octal-digit \ octal-digit
@ -2699,7 +2699,7 @@ def main():
rules_violated[misra_id] = rules_violated.get(misra_id, 0) + 1 rules_violated[misra_id] = rules_violated.get(misra_id, 0) + 1
print("MISRA rules violated:") print("MISRA rules violated:")
convert = lambda text: int(text) if text.isdigit() else text convert = lambda text: int(text) if text.isdigit() else text
misra_sort = lambda key: [ convert(c) for c in re.split('[\.-]([0-9]*)', key) ] misra_sort = lambda key: [ convert(c) for c in re.split('[.-]([0-9]*)', key) ]
for misra_id in sorted(rules_violated.keys(), key=misra_sort): for misra_id in sorted(rules_violated.keys(), key=misra_sort):
res = re.match(r'misra-c2012-([0-9]+)\\.([0-9]+)', misra_id) res = re.match(r'misra-c2012-([0-9]+)\\.([0-9]+)', misra_id)
if res is None: if res is None:

View File

@ -5,6 +5,13 @@ enable=mixed-indentation,
print-statement, print-statement,
literal-comparison, literal-comparison,
unnecessary-semicolon, unnecessary-semicolon,
mixed-line-endings,
bad-open-mode,
redundant-unittest-assert,
boolean-datetime,
deprecated-method,
anomalous-unicode-escape-in-string,
anomalous-backslash-in-string,
#bad-indentation #bad-indentation
[REPORTS] [REPORTS]
reports=no reports=no

View File

@ -72,7 +72,7 @@ class Extract:
continue continue
# check # check
res = re.match('\s+check.*\(' + string, line) res = re.match('\\s+check.*\\(' + string, line)
if res is not None: if res is not None:
code = res.group(1) code = res.group(1)