mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Valentin Rothberg <valentinrothberg@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org,
	Valentin Rothberg <valentinrothberg@gmail.com>
Subject: [PATCH v2 3/5] checkkconfigsymbols.py: fix pylint and pep8 warnings
Date: Sun, 28 Aug 2016 08:51:30 +0200	[thread overview]
Message-ID: <20160828065132.74259-4-valentinrothberg@gmail.com> (raw)
In-Reply-To: <20160828065132.74259-1-valentinrothberg@gmail.com>

Fix pylint and pep8 warnings to have a consistent syntax and style.

Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
---
 scripts/checkkconfigsymbols.py | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/scripts/checkkconfigsymbols.py b/scripts/checkkconfigsymbols.py
index 322c5e817b4c..4111746b5110 100755
--- a/scripts/checkkconfigsymbols.py
+++ b/scripts/checkkconfigsymbols.py
@@ -16,7 +16,6 @@ import signal
 import subprocess
 import sys
 from multiprocessing import Pool, cpu_count
-from subprocess import Popen, PIPE, STDOUT
 
 
 # regex expressions
@@ -118,8 +117,8 @@ def main():
     """Main function of this module."""
     args = parse_options()
 
-    global color
-    color = args.color and sys.stdout.isatty()
+    global COLOR
+    COLOR = args.color and sys.stdout.isatty()
 
     if args.sim and not args.commit and not args.diff:
         sims = find_sims(args.sim, args.ignore)
@@ -160,7 +159,7 @@ def main():
         # report cases that are present for the commit but not before
         for feature in sorted(undefined_b):
             # feature has not been undefined before
-            if not feature in undefined_a:
+            if feature not in undefined_a:
                 files = sorted(undefined_b.get(feature))
                 undefined[feature] = files
             # check if there are new files that reference the undefined feature
@@ -200,21 +199,21 @@ def main():
                     print("\t- %s (\"%s\")" % (yel(commit[0]), commit[1]))
             else:
                 print("\t- no commit found")
-        print()  #  new line
+        print()  # new line
 
 
 def yel(string):
     """
     Color %string yellow.
     """
-    return "\033[33m%s\033[0m" % string if color else string
+    return "\033[33m%s\033[0m" % string if COLOR else string
 
 
 def red(string):
     """
     Color %string red.
     """
-    return "\033[31m%s\033[0m" % string if color else string
+    return "\033[31m%s\033[0m" % string if COLOR else string
 
 
 def execute(cmd):
@@ -261,7 +260,7 @@ def init_worker():
     signal.signal(signal.SIGINT, signal.SIG_IGN)
 
 
-def find_sims(symbol, ignore, defined = []):
+def find_sims(symbol, ignore, defined=[]):
     """Return a list of max. ten Kconfig symbols that are string-similar to
     @symbol."""
     if defined:
@@ -335,7 +334,6 @@ def check_symbols_helper(pool, ignore):
     for res in pool.map(parse_source_files, arglist):
         referenced_features.update(res)
 
-
     # parse kconfig files
     arglist = []
     for part in partition(kconfig_files, cpu_count()):
@@ -389,7 +387,7 @@ def parse_source_file(sfile):
         lines = stream.readlines()
 
     for line in lines:
-        if not "CONFIG_" in line:
+        if "CONFIG_" not in line:
             continue
         features = REGEX_SOURCE_FEATURE.findall(line)
         for feature in features:
-- 
2.9.3

  parent reply	other threads:[~2016-08-28  6:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-28  6:51 [PATCH v2 0/5] checkkconfigsymbols: several updates Valentin Rothberg
2016-08-28  6:51 ` [PATCH v2 1/5] checkkconfigsymbols.py: port to Python 3 Valentin Rothberg
2016-08-28  6:51 ` [PATCH v2 2/5] checkkconfigsymbols: use ArgumentParser Valentin Rothberg
2016-08-28  6:51 ` Valentin Rothberg [this message]
2016-08-28  6:51 ` [PATCH v2 4/5] checkkconfigsymblos: consistent symbol terminology Valentin Rothberg
2016-08-28  6:51 ` [PATCH v2 5/5] checkkconfigsymbols: use arglist instead of cmd string Valentin Rothberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160828065132.74259-4-valentinrothberg@gmail.com \
    --to=valentinrothberg@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®