mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-24 04:32:46 +00:00
add pep8 tests and fix redundant backslashes between brackets
This commit is contained in:
parent
4fe4ed4de7
commit
7846ee875d
6 changed files with 7 additions and 6 deletions
|
@ -399,7 +399,7 @@ class Builder(ConfigObject, BuilderBase):
|
||||||
"""
|
"""
|
||||||
self._setup_sources()
|
self._setup_sources()
|
||||||
|
|
||||||
run_command("cp %s/%s %s/" % \
|
run_command("cp %s/%s %s/" %
|
||||||
(self.rpmbuild_sourcedir, self.tgz_filename,
|
(self.rpmbuild_sourcedir, self.tgz_filename,
|
||||||
self.rpmbuild_basedir))
|
self.rpmbuild_basedir))
|
||||||
|
|
||||||
|
|
|
@ -329,7 +329,7 @@ class BuildModule(BaseCliModule):
|
||||||
help="Build rpm")
|
help="Build rpm")
|
||||||
self.parser.add_option("-i", "--install", dest="auto_install",
|
self.parser.add_option("-i", "--install", dest="auto_install",
|
||||||
action="store_true", default=False,
|
action="store_true", default=False,
|
||||||
help="Install any binary rpms being built. (WARNING: " + \
|
help="Install any binary rpms being built. (WARNING: " +
|
||||||
"uses sudo rpm -Uvh --force)")
|
"uses sudo rpm -Uvh --force)")
|
||||||
self.parser.add_option("--dist", dest="dist", metavar="DISTTAG",
|
self.parser.add_option("--dist", dest="dist", metavar="DISTTAG",
|
||||||
help="Dist tag to apply to srpm and/or rpm. (i.e. .el5)")
|
help="Dist tag to apply to srpm and/or rpm. (i.e. .el5)")
|
||||||
|
|
|
@ -196,7 +196,7 @@ def find_git_root():
|
||||||
"""
|
"""
|
||||||
(status, cdup) = commands.getstatusoutput("git rev-parse --show-cdup")
|
(status, cdup) = commands.getstatusoutput("git rev-parse --show-cdup")
|
||||||
if status > 0:
|
if status > 0:
|
||||||
error_out(["%s does not appear to be within a git checkout." % \
|
error_out(["%s does not appear to be within a git checkout." %
|
||||||
os.getcwd()])
|
os.getcwd()])
|
||||||
|
|
||||||
if cdup.strip() == "":
|
if cdup.strip() == "":
|
||||||
|
|
|
@ -26,9 +26,9 @@ class DistributionBuilder(UpstreamBuilder):
|
||||||
ch_dir = os.path.join(self.git_root,
|
ch_dir = os.path.join(self.git_root,
|
||||||
self.relative_project_dir)
|
self.relative_project_dir)
|
||||||
os.chdir(ch_dir)
|
os.chdir(ch_dir)
|
||||||
debug("Running /usr/bin/generate-patches.pl -d %s %s %s-1 %s %s" \
|
debug("Running /usr/bin/generate-patches.pl -d %s %s %s-1 %s %s"
|
||||||
% (self.rpmbuild_gitcopy, self.project_name, self.upstream_version, self.build_version, self.git_commit_id))
|
% (self.rpmbuild_gitcopy, self.project_name, self.upstream_version, self.build_version, self.git_commit_id))
|
||||||
output = run_command("/usr/bin/generate-patches.pl -d %s %s %s-1 %s %s" \
|
output = run_command("/usr/bin/generate-patches.pl -d %s %s %s-1 %s %s"
|
||||||
% (self.rpmbuild_gitcopy, self.project_name, self.upstream_version, self.build_version, self.git_commit_id))
|
% (self.rpmbuild_gitcopy, self.project_name, self.upstream_version, self.build_version, self.git_commit_id))
|
||||||
self.patch_files = output.split("\n")
|
self.patch_files = output.split("\n")
|
||||||
for p_file in self.patch_files:
|
for p_file in self.patch_files:
|
||||||
|
|
|
@ -227,7 +227,7 @@ class VersionTagger(ConfigObject):
|
||||||
|
|
||||||
fd, name = tempfile.mkstemp()
|
fd, name = tempfile.mkstemp()
|
||||||
os.write(fd, "# Create your changelog entry below:\n")
|
os.write(fd, "# Create your changelog entry below:\n")
|
||||||
if self.git_email is None or (('HIDE_EMAIL' in self.user_config) and \
|
if self.git_email is None or (('HIDE_EMAIL' in self.user_config) and
|
||||||
(self.user_config['HIDE_EMAIL'] not in ['0', ''])):
|
(self.user_config['HIDE_EMAIL'] not in ['0', ''])):
|
||||||
header = "* %s %s\n" % (self.today, self.git_user)
|
header = "* %s %s\n" % (self.today, self.git_user)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -35,6 +35,7 @@ class TestPep8(TitoUnitTestFixture):
|
||||||
'E2', # whitespace errors
|
'E2', # whitespace errors
|
||||||
'E3', # blank line errors
|
'E3', # blank line errors
|
||||||
'E4', # import errors
|
'E4', # import errors
|
||||||
|
'E502', # the backslash is redundant between brackets
|
||||||
'E7', # statement errors
|
'E7', # statement errors
|
||||||
'E9', # runtime errors (SyntaxError, IndentationError, IOError)
|
'E9', # runtime errors (SyntaxError, IndentationError, IOError)
|
||||||
'W2', # whitespace warnings
|
'W2', # whitespace warnings
|
||||||
|
|
Loading…
Add table
Reference in a new issue