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):
"""Checks that given symbols are valid octal escape sequence:
r"""Checks that given symbols are valid octal escape sequence:
octal-escape-sequence:
\ octal-digit
@ -2699,7 +2699,7 @@ def main():
rules_violated[misra_id] = rules_violated.get(misra_id, 0) + 1
print("MISRA rules violated:")
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):
res = re.match(r'misra-c2012-([0-9]+)\\.([0-9]+)', misra_id)
if res is None:

View File

@ -5,6 +5,13 @@ enable=mixed-indentation,
print-statement,
literal-comparison,
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
[REPORTS]
reports=no

View File

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