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
This commit is contained in:
David Pursehouse
2012-11-14 12:09:38 +09:00
parent c1b86a2323
commit 8f62fb7bd3
10 changed files with 28 additions and 28 deletions

View File

@ -33,13 +33,13 @@ makes it available in your project's local working directory.
"""
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")

View File

@ -85,7 +85,7 @@ contain a line that matches both expressions:
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 @@ contain a line that matches both expressions:
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 @@ contain a line that matches both expressions:
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 @@ contain a line that matches both expressions:
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 @@ contain a line that matches both expressions:
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:

View File

@ -126,7 +126,7 @@ Displays detailed usage information about a command.
p('%s', title)
self.nl()
p('%s', ''.ljust(len(title),section_type[0]))
p('%s', ''.ljust(len(title), section_type[0]))
self.nl()
continue

View File

@ -279,14 +279,14 @@ to update the working directory files.
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()

View File

@ -150,22 +150,22 @@ later is required to fix a server side protocol bug.
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',

View File

@ -50,7 +50,7 @@ def _SplitEmails(values):
class Upload(InteractiveCommand):
common = True
helpSummary = "Upload changes for code review"
helpUsage="""
helpUsage = """
%prog [--re --cc] [<project>]...
"""
helpDescription = """
@ -397,7 +397,7 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
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)