From 1db6122021b7b6b94922a9fa08e6ec2afb5adbd6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 20 Mar 2016 14:23:28 -0400 Subject: pylint cleanup. --- Makefile | 2 +- deheader | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index aab3cf5..abe814b 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/deheader b/deheader index dfdfb09..519de87 100755 --- a/deheader +++ b/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] == '<': -- cgit v1.2.3-70-g09d2