diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2016-03-20 14:23:28 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2016-03-20 14:23:28 -0400 |
commit | 1db6122021b7b6b94922a9fa08e6ec2afb5adbd6 (patch) | |
tree | 030effb1c9e3cb4da13d2612af9b1793d42a1898 | |
parent | 94df66548d525e556cd269113dcce52127a7190a (diff) | |
download | deheader-1db6122021b7b6b94922a9fa08e6ec2afb5adbd6.tar.gz deheader-1db6122021b7b6b94922a9fa08e6ec2afb5adbd6.tar.bz2 deheader-1db6122021b7b6b94922a9fa08e6ec2afb5adbd6.tar.xz deheader-1db6122021b7b6b94922a9fa08e6ec2afb5adbd6.zip |
pylint cleanup.
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | deheader | 6 |
2 files changed, 5 insertions, 3 deletions
@@ -26,7 +26,7 @@ makeregress: PYLINTOPTS = --rcfile=/dev/null --reports=n \ --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \ --dummy-variables-rgx='^_' -SUPPRESSIONS = --disable="C0103,C0111,C0301,C0302,C0323,C1001,R0903,R0912,R0913,R0914,R0915,W0110,W0141,W0611,W0621" +SUPPRESSIONS = --disable="C0103,C0111,C0301,C0302,C0323,C1001,R0903,R0912,R0913,R0914,R0915,W0110,W0141,W0611,W0621,E0611" pylint: @pylint $(PYLINTOPTS) $(SUPPRESSIONS) deheader @@ -31,6 +31,8 @@ The last line of the output is a statistical summary of operations. """ # SPDX-License-Identifier: BSD-2-Clause +from __future__ import print_function + import sys, os, getopt, time, re, operator, subprocess version = "1.3" @@ -1343,7 +1345,7 @@ class SaveForModification: def match_preproc(directives, line): if not isinstance(directives, list): directives = [directives] - regexp = "|".join(["#\s*" + d for d in directives]) + regexp = "|".join([r"#\s*" + d for d in directives]) m = re.match(regexp, line) if m: return line[m.span()[1]:].strip() @@ -1351,7 +1353,7 @@ def match_preproc(directives, line): def trim(line): "Get file reference from an #include, retaining <> if a system header." - trimmed = re.sub("^#\s*include", "", line).strip() + trimmed = re.sub(r"^#\s*include", "", line).strip() if trimmed[0] in '"': return '"' + trimmed.split('"')[1] + '"' elif trimmed[0] == '<': |