Fix indentation issues reported by flake8
- E121 continuation line under-indented for hanging indent
- E122 continuation line missing indentation or outdented
- E125 continuation line with same indent as next logical line
- E126 continuation line over-indented for hanging indent
- E127 continuation line over-indented for visual indent
- E128 continuation line under-indented for visual indent
- E129 visually indented line with same indent as next logical line
- E131 continuation line unaligned for hanging indent
Fixed automatically with autopep8:
git ls-files | grep py$ | xargs autopep8 --in-place \
--select E121,E122,E125,E126,E127,E128,E129,E131
Change-Id: Ifd95fb8e6a1a4d6e9de187b5787d64a6326dd249
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254605
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: David Pursehouse <dpursehouse@collab.net>
diff --git a/subcmds/__init__.py b/subcmds/__init__.py
index 2734103..9cc9471 100644
--- a/subcmds/__init__.py
+++ b/subcmds/__init__.py
@@ -40,7 +40,7 @@
cmd = getattr(mod, clsn)()
except AttributeError:
raise SyntaxError('%s/%s does not define class %s' % (
- __name__, py, clsn))
+ __name__, py, clsn))
name = name.replace('_', '-')
cmd.NAME = name
diff --git a/subcmds/abandon.py b/subcmds/abandon.py
index ba4ef09..9a645c0 100644
--- a/subcmds/abandon.py
+++ b/subcmds/abandon.py
@@ -95,5 +95,5 @@
result = "all project"
else:
result = "%s" % (
- ('\n' + ' ' * width + '| ').join(p.relpath for p in success[br]))
+ ('\n' + ' ' * width + '| ').join(p.relpath for p in success[br]))
print("%s%s| %s\n" % (br, ' ' * (width - len(br)), result), file=sys.stderr)
diff --git a/subcmds/forall.py b/subcmds/forall.py
index 9706760..5d2be91 100644
--- a/subcmds/forall.py
+++ b/subcmds/forall.py
@@ -28,10 +28,10 @@
import platform_utils
_CAN_COLOR = [
- 'branch',
- 'diff',
- 'grep',
- 'log',
+ 'branch',
+ 'diff',
+ 'grep',
+ 'log',
]
@@ -170,14 +170,14 @@
else:
lrev = None
return {
- 'name': project.name,
- 'relpath': project.relpath,
- 'remote_name': project.remote.name,
- 'lrev': lrev,
- 'rrev': project.revisionExpr,
- 'annotations': dict((a.name, a.value) for a in project.annotations),
- 'gitdir': project.gitdir,
- 'worktree': project.worktree,
+ 'name': project.name,
+ 'relpath': project.relpath,
+ 'remote_name': project.remote.name,
+ 'lrev': lrev,
+ 'rrev': project.revisionExpr,
+ 'annotations': dict((a.name, a.value) for a in project.annotations),
+ 'gitdir': project.gitdir,
+ 'worktree': project.worktree,
}
def ValidateOptions(self, opt, args):
@@ -196,8 +196,8 @@
cmd.extend(opt.command[1:])
if opt.project_header \
- and not shell \
- and cmd[0] == 'git':
+ and not shell \
+ and cmd[0] == 'git':
# If this is a direct git command that can enable colorized
# output and the user prefers coloring, add --color into the
# command line because we are going to wrap the command into
@@ -220,7 +220,7 @@
smart_sync_manifest_name = "smart_sync_override.xml"
smart_sync_manifest_path = os.path.join(
- self.manifest.manifestProject.worktree, smart_sync_manifest_name)
+ self.manifest.manifestProject.worktree, smart_sync_manifest_name)
if os.path.isfile(smart_sync_manifest_path):
self.manifest.Override(smart_sync_manifest_path)
@@ -238,8 +238,8 @@
try:
config = self.manifest.manifestProject.config
results_it = pool.imap(
- DoWorkWrapper,
- self.ProjectArgs(projects, mirror, opt, cmd, shell, config))
+ DoWorkWrapper,
+ self.ProjectArgs(projects, mirror, opt, cmd, shell, config))
pool.close()
for r in results_it:
rc = rc or r
@@ -253,7 +253,7 @@
except Exception as e:
# Catch any other exceptions raised
print('Got an error, terminating the pool: %s: %s' %
- (type(e).__name__, e),
+ (type(e).__name__, e),
file=sys.stderr)
pool.terminate()
rc = rc or getattr(e, 'errno', 1)
@@ -268,7 +268,7 @@
project = self._SerializeProject(p)
except Exception as e:
print('Project list error on project %s: %s: %s' %
- (p.name, type(e).__name__, e),
+ (p.name, type(e).__name__, e),
file=sys.stderr)
return
except KeyboardInterrupt:
@@ -331,7 +331,7 @@
if opt.ignore_missing:
return 0
if ((opt.project_header and opt.verbose)
- or not opt.project_header):
+ or not opt.project_header):
print('skipping %s/' % project['relpath'], file=sys.stderr)
return 1
diff --git a/subcmds/help.py b/subcmds/help.py
index 7893050..93b9a86 100644
--- a/subcmds/help.py
+++ b/subcmds/help.py
@@ -72,13 +72,13 @@
return False
commandNames = list(sorted([name
- for name, command in self.commands.items()
- if command.common and gitc_supported(command)]))
+ for name, command in self.commands.items()
+ if command.common and gitc_supported(command)]))
self._PrintCommands(commandNames)
print(
-"See 'repo help <command>' for more information on a specific command.\n"
-"See 'repo help --all' for a complete list of recognized commands.")
+ "See 'repo help <command>' for more information on a specific command.\n"
+ "See 'repo help --all' for a complete list of recognized commands.")
def _PrintCommandHelp(self, cmd, header_prefix=''):
class _Out(Coloring):
diff --git a/subcmds/info.py b/subcmds/info.py
index a6faf16..96fa6a4 100644
--- a/subcmds/info.py
+++ b/subcmds/info.py
@@ -195,11 +195,11 @@
commits = branch.commits
date = branch.date
self.text('%s %-33s (%2d commit%s, %s)' % (
- branch.name == project.CurrentBranch and '*' or ' ',
- branch.name,
- len(commits),
- len(commits) != 1 and 's' or '',
- date))
+ branch.name == project.CurrentBranch and '*' or ' ',
+ branch.name,
+ len(commits),
+ len(commits) != 1 and 's' or '',
+ date))
self.out.nl()
for commit in commits:
diff --git a/subcmds/init.py b/subcmds/init.py
index 191f02b..7181b86 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -223,7 +223,7 @@
platformize = lambda x: 'platform-' + x
if opt.platform == 'auto':
if (not opt.mirror and
- not m.config.GetString('repo.mirror') == 'true'):
+ not m.config.GetString('repo.mirror') == 'true'):
groups.append(platformize(platform.system().lower()))
elif opt.platform == 'all':
groups.extend(map(platformize, all_platforms))
@@ -280,10 +280,10 @@
m.config.SetString('repo.submodules', 'true')
if not m.Sync_NetworkHalf(is_new=is_new, quiet=opt.quiet,
- clone_bundle=not opt.no_clone_bundle,
- current_branch_only=opt.current_branch_only,
- no_tags=opt.no_tags, submodules=opt.submodules,
- clone_filter=opt.clone_filter):
+ clone_bundle=not opt.no_clone_bundle,
+ current_branch_only=opt.current_branch_only,
+ no_tags=opt.no_tags, submodules=opt.submodules,
+ clone_filter=opt.clone_filter):
r = m.GetRemote(m.remote.name)
print('fatal: cannot obtain manifest %s' % r.url, file=sys.stderr)
diff --git a/subcmds/rebase.py b/subcmds/rebase.py
index dcb8b2a..eb92a3c 100644
--- a/subcmds/rebase.py
+++ b/subcmds/rebase.py
@@ -43,8 +43,8 @@
def _Options(self, p):
p.add_option('-i', '--interactive',
- dest="interactive", action="store_true",
- help="interactive rebase (single project only)")
+ dest="interactive", action="store_true",
+ help="interactive rebase (single project only)")
p.add_option('--fail-fast',
dest='fail_fast', action='store_true',
@@ -82,7 +82,7 @@
file=sys.stderr)
if len(args) == 1:
print('note: project %s is mapped to more than one path' % (args[0],),
- file=sys.stderr)
+ file=sys.stderr)
return 1
# Setup the common git rebase args that we use for all projects.
diff --git a/subcmds/start.py b/subcmds/start.py
index 9b81086..f98f790 100644
--- a/subcmds/start.py
+++ b/subcmds/start.py
@@ -113,7 +113,7 @@
branch_merge = self.manifest.default.revisionExpr
if not project.StartBranch(
- nb, branch_merge=branch_merge, revision=opt.revision):
+ nb, branch_merge=branch_merge, revision=opt.revision):
err.append(project)
pm.end()
diff --git a/subcmds/status.py b/subcmds/status.py
index 6012ae2..a04ba92 100644
--- a/subcmds/status.py
+++ b/subcmds/status.py
@@ -126,8 +126,8 @@
continue
if item in proj_dirs_parents:
self._FindOrphans(glob.glob('%s/.*' % item) +
- glob.glob('%s/*' % item),
- proj_dirs, proj_dirs_parents, outstring)
+ glob.glob('%s/*' % item),
+ proj_dirs, proj_dirs_parents, outstring)
continue
outstring.append(''.join([status_header, item, '/']))
@@ -179,8 +179,8 @@
outstring = []
self._FindOrphans(glob.glob('.*') +
- glob.glob('*'),
- proj_dirs, proj_dirs_parents, outstring)
+ glob.glob('*'),
+ proj_dirs, proj_dirs_parents, outstring)
if outstring:
output = StatusColoring(self.manifest.globalConfig)
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 9e4c775..1ea102c 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -327,14 +327,14 @@
try:
try:
success = project.Sync_NetworkHalf(
- quiet=opt.quiet,
- current_branch_only=opt.current_branch_only,
- force_sync=opt.force_sync,
- clone_bundle=not opt.no_clone_bundle,
- no_tags=opt.no_tags, archive=self.manifest.IsArchive,
- optimized_fetch=opt.optimized_fetch,
- prune=opt.prune,
- clone_filter=clone_filter)
+ quiet=opt.quiet,
+ current_branch_only=opt.current_branch_only,
+ force_sync=opt.force_sync,
+ clone_bundle=not opt.no_clone_bundle,
+ no_tags=opt.no_tags, archive=self.manifest.IsArchive,
+ optimized_fetch=opt.optimized_fetch,
+ prune=opt.prune,
+ clone_filter=clone_filter)
self._fetch_times.Set(project, time.time() - start)
# Lock around all the rest of the code, since printing, updating a set
@@ -356,7 +356,7 @@
pass
except Exception as e:
print('error: Cannot fetch %s (%s: %s)'
- % (project.name, type(e).__name__, str(e)), file=sys.stderr)
+ % (project.name, type(e).__name__, str(e)), file=sys.stderr)
err_event.set()
raise
finally:
@@ -704,16 +704,16 @@
gitdir = os.path.join(self.manifest.topdir, path, '.git')
if os.path.exists(gitdir):
project = Project(
- manifest=self.manifest,
- name=path,
- remote=RemoteSpec('origin'),
- gitdir=gitdir,
- objdir=gitdir,
- worktree=os.path.join(self.manifest.topdir, path),
- relpath=path,
- revisionExpr='HEAD',
- revisionId=None,
- groups=None)
+ manifest=self.manifest,
+ name=path,
+ remote=RemoteSpec('origin'),
+ gitdir=gitdir,
+ objdir=gitdir,
+ worktree=os.path.join(self.manifest.topdir, path),
+ relpath=path,
+ revisionExpr='HEAD',
+ revisionId=None,
+ groups=None)
if project.IsDirty() and opt.force_remove_dirty:
print('WARNING: Removing dirty project "%s": uncommitted changes '
@@ -885,7 +885,7 @@
manifest_name = opt.manifest_name
smart_sync_manifest_path = os.path.join(
- self.manifest.manifestProject.worktree, 'smart_sync_override.xml')
+ self.manifest.manifestProject.worktree, 'smart_sync_override.xml')
if opt.smart_sync or opt.smart_tag:
manifest_name = self._SmartSyncSetup(opt, smart_sync_manifest_path)
diff --git a/subcmds/upload.py b/subcmds/upload.py
index c0f870e..180496f 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -218,10 +218,10 @@
print('Upload project %s/ to remote branch %s%s:' %
(project.relpath, destination, ' (draft)' if opt.draft else ''))
print(' branch %s (%2d commit%s, %s):' % (
- name,
- len(commit_list),
- len(commit_list) != 1 and 's' or '',
- date))
+ name,
+ len(commit_list),
+ len(commit_list) != 1 and 's' or '',
+ date))
for commit in commit_list:
print(' %s' % commit)
@@ -422,18 +422,18 @@
else:
fmt = '\n (%s)'
print(('[FAILED] %-15s %-15s' + fmt) % (
- branch.project.relpath + '/',
- branch.name,
- str(branch.error)),
- file=sys.stderr)
+ branch.project.relpath + '/',
+ branch.name,
+ str(branch.error)),
+ file=sys.stderr)
print()
for branch in todo:
if branch.uploaded:
print('[OK ] %-15s %s' % (
- branch.project.relpath + '/',
- branch.name),
- file=sys.stderr)
+ branch.project.relpath + '/',
+ branch.name),
+ file=sys.stderr)
if have_errors:
sys.exit(1)