Tidy up code formatting a bit more
Enable the following Pylint warnings:
C0322: Operator not preceded by a space
C0323: Operator not followed by a space
C0324: Comma not followed by a space
And make the necessary fixes.
Change-Id: I74d74283ad5138cbaf28d492b18614eb355ff9fe
diff --git a/.pylintrc b/.pylintrc
index 72dccd7..9e8882e 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -53,7 +53,7 @@
enable=RP0004
# Disable the message(s) with the given id(s).
-disable=R0903,R0912,R0913,R0914,R0915,W0141,C0111,C0103,C0323,C0322,C0324,W0603,W0703,R0911,C0301,C0302,R0902,R0904,W0142,W0212,E1101,E1103,R0201,W0201,W0122,W0232,RP0001,RP0003,RP0101,RP0002,RP0401,RP0701,RP0801
+disable=R0903,R0912,R0913,R0914,R0915,W0141,C0111,C0103,W0603,W0703,R0911,C0301,C0302,R0902,R0904,W0142,W0212,E1101,E1103,R0201,W0201,W0122,W0232,RP0001,RP0003,RP0101,RP0002,RP0401,RP0701,RP0801
[REPORTS]
diff --git a/git_config.py b/git_config.py
index 108438f..56cc6a2 100644
--- a/git_config.py
+++ b/git_config.py
@@ -431,7 +431,7 @@
'-o','ControlPath %s' % ssh_sock(),
host]
if port is not None:
- command_base[1:1] = ['-p',str(port)]
+ command_base[1:1] = ['-p', str(port)]
# Since the key wasn't in _master_keys, we think that master isn't running.
# ...but before actually starting a master, we'll double-check. This can
diff --git a/project.py b/project.py
index 6507241..75c5e5e 100644
--- a/project.py
+++ b/project.py
@@ -556,7 +556,7 @@
'--unmerged',
'--ignore-missing',
'--refresh')
- if self.work_git.DiffZ('diff-index','-M','--cached',HEAD):
+ if self.work_git.DiffZ('diff-index', '-M', '--cached', HEAD):
return True
if self.work_git.DiffZ('diff-files'):
return True
@@ -1880,7 +1880,7 @@
self.level = self.level[1:]
info = info[1:].split(' ')
- info =_Info(path, *info)
+ info = _Info(path, *info)
if info.status in ('R', 'C'):
info.src_path = info.path
info.path = out.next()
diff --git a/repo b/repo
index 4d8e8dc..32c5895 100755
--- a/repo
+++ b/repo
@@ -3,8 +3,8 @@
## repo default configuration
##
from __future__ import print_function
-REPO_URL='https://gerrit.googlesource.com/git-repo'
-REPO_REV='stable'
+REPO_URL = 'https://gerrit.googlesource.com/git-repo'
+REPO_REV = 'stable'
# Copyright (C) 2008 Google Inc.
#
@@ -24,7 +24,7 @@
VERSION = (1, 19)
# increment this if the MAINTAINER_KEYS block is modified
-KEYRING_VERSION = (1,1)
+KEYRING_VERSION = (1, 1)
MAINTAINER_KEYS = """
Repo Maintainer <repo@android.kernel.org>
diff --git a/subcmds/download.py b/subcmds/download.py
index 6aa54af..471e88b 100644
--- a/subcmds/download.py
+++ b/subcmds/download.py
@@ -33,13 +33,13 @@
"""
def _Options(self, p):
- p.add_option('-c','--cherry-pick',
+ p.add_option('-c', '--cherry-pick',
dest='cherrypick', action='store_true',
help="cherry-pick instead of checkout")
- p.add_option('-r','--revert',
+ p.add_option('-r', '--revert',
dest='revert', action='store_true',
help="revert instead of checkout")
- p.add_option('-f','--ff-only',
+ p.add_option('-f', '--ff-only',
dest='ffonly', action='store_true',
help="force fast-forward merge")
diff --git a/subcmds/grep.py b/subcmds/grep.py
index fa5f876..dd391cf 100644
--- a/subcmds/grep.py
+++ b/subcmds/grep.py
@@ -85,7 +85,7 @@
g.add_option('--cached',
action='callback', callback=carry,
help='Search the index, instead of the work tree')
- g.add_option('-r','--revision',
+ g.add_option('-r', '--revision',
dest='revision', action='append', metavar='TREEish',
help='Search TREEish, instead of the work tree')
@@ -97,7 +97,7 @@
g.add_option('-i', '--ignore-case',
action='callback', callback=carry,
help='Ignore case differences')
- g.add_option('-a','--text',
+ g.add_option('-a', '--text',
action='callback', callback=carry,
help="Process binary files as if they were text")
g.add_option('-I',
@@ -126,7 +126,7 @@
g.add_option('--and', '--or', '--not',
action='callback', callback=carry,
help='Boolean operators to combine patterns')
- g.add_option('-(','-)',
+ g.add_option('-(', '-)',
action='callback', callback=carry,
help='Boolean operator grouping')
@@ -146,10 +146,10 @@
action='callback', callback=carry,
metavar='CONTEXT', type='str',
help='Show CONTEXT lines after match')
- g.add_option('-l','--name-only','--files-with-matches',
+ g.add_option('-l', '--name-only', '--files-with-matches',
action='callback', callback=carry,
help='Show only file names containing matching lines')
- g.add_option('-L','--files-without-match',
+ g.add_option('-L', '--files-without-match',
action='callback', callback=carry,
help='Show only file names not containing matching lines')
@@ -158,9 +158,9 @@
out = GrepColoring(self.manifest.manifestProject.config)
cmd_argv = ['grep']
- if out.is_on and git_require((1,6,3)):
+ if out.is_on and git_require((1, 6, 3)):
cmd_argv.append('--color')
- cmd_argv.extend(getattr(opt,'cmd_argv',[]))
+ cmd_argv.extend(getattr(opt, 'cmd_argv', []))
if '-e' not in cmd_argv:
if not args:
diff --git a/subcmds/help.py b/subcmds/help.py
index 57fb3cc..15aab7f 100644
--- a/subcmds/help.py
+++ b/subcmds/help.py
@@ -126,7 +126,7 @@
p('%s', title)
self.nl()
- p('%s', ''.ljust(len(title),section_type[0]))
+ p('%s', ''.ljust(len(title), section_type[0]))
self.nl()
continue
diff --git a/subcmds/init.py b/subcmds/init.py
index 7aaa7f1..eeadc70 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -279,14 +279,14 @@
print()
print("Testing colorized output (for 'repo diff', 'repo status'):")
- for c in ['black','red','green','yellow','blue','magenta','cyan']:
+ for c in ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan']:
out.write(' ')
out.printer(fg=c)(' %-6s ', c)
out.write(' ')
out.printer(fg='white', bg='black')(' %s ' % 'white')
out.nl()
- for c in ['bold','dim','ul','reverse']:
+ for c in ['bold', 'dim', 'ul', 'reverse']:
out.write(' ')
out.printer(fg='black', attr=c)(' %-6s ', c)
out.nl()
diff --git a/subcmds/sync.py b/subcmds/sync.py
index df64ab0..5b3dca7 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -150,22 +150,22 @@
p.add_option('-f', '--force-broken',
dest='force_broken', action='store_true',
help="continue sync even if a project fails to sync")
- p.add_option('-l','--local-only',
+ p.add_option('-l', '--local-only',
dest='local_only', action='store_true',
help="only update working tree, don't fetch")
- p.add_option('-n','--network-only',
+ p.add_option('-n', '--network-only',
dest='network_only', action='store_true',
help="fetch only, don't update working tree")
- p.add_option('-d','--detach',
+ p.add_option('-d', '--detach',
dest='detach_head', action='store_true',
help='detach projects back to manifest revision')
- p.add_option('-c','--current-branch',
+ p.add_option('-c', '--current-branch',
dest='current_branch_only', action='store_true',
help='fetch only current branch from server')
- p.add_option('-q','--quiet',
+ p.add_option('-q', '--quiet',
dest='quiet', action='store_true',
help='be more quiet')
- p.add_option('-j','--jobs',
+ p.add_option('-j', '--jobs',
dest='jobs', action='store', type='int',
help="projects to fetch simultaneously (default %d)" % self.jobs)
p.add_option('-m', '--manifest-name',
diff --git a/subcmds/upload.py b/subcmds/upload.py
index 219c509..e314032 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -50,7 +50,7 @@
class Upload(InteractiveCommand):
common = True
helpSummary = "Upload changes for code review"
- helpUsage="""
+ helpUsage = """
%prog [--re --cc] [<project>]...
"""
helpDescription = """
@@ -397,7 +397,7 @@
reviewers = _SplitEmails(opt.reviewers)
if opt.cc:
cc = _SplitEmails(opt.cc)
- people = (reviewers,cc)
+ people = (reviewers, cc)
if not pending:
print("no branches ready for upload", file=sys.stderr)