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/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)