diff options
author | Guido Günther <agx@sigxcpu.org> | 2017-01-06 10:29:22 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2017-01-06 10:29:22 +0100 |
commit | 25fbbf0868efdfa3c817ac79824199fa93c4f7fd (patch) | |
tree | 4990c76be339fe36e967ec62ebdf55d7e05629be | |
parent | de345798944b38c5d1820deae7b6f44c5e267872 (diff) |
flake8 check examples
-rw-r--r-- | Makefile | 3 | ||||
-rwxr-xr-x | examples/gbp-add-patch | 12 |
2 files changed, 10 insertions, 5 deletions
@@ -1,3 +1,5 @@ +PY_EXAMPLES=$(shell grep -l /usr/bin/python examples/*) + all: syntax-check test all+net: @@ -13,6 +15,7 @@ test: syntax-check: flake8 -j1 + flake8 -j1 $(PY_EXAMPLES) docs: make -C docs diff --git a/examples/gbp-add-patch b/examples/gbp-add-patch index 4ccd1fa7..0c88d58f 100755 --- a/examples/gbp-add-patch +++ b/examples/gbp-add-patch @@ -35,9 +35,10 @@ from __future__ import print_function import re import sys -import os, os.path +import os +import os.path from gbp.command_wrappers import (Command) -from gbp.config import (GbpOptionParserDebian, GbpOptionGroup) +from gbp.config import GbpOptionParserDebian from gbp.errors import GbpError from gbp.git import (GitRepositoryError, GitRepository) from gbp.patch_series import Patch @@ -58,7 +59,7 @@ def build_commit_msg(repo, patch, options): closes += line + '\n' patch_name = os.path.basename(patch.path) - msg="""New patch %s + msg = """New patch %s %s %s @@ -70,9 +71,9 @@ def main(argv): retval = 0 parser = GbpOptionParserDebian(command=os.path.basename(argv[0]), prefix='', - usage='%prog [options] - add a new patch') + usage='%prog [options] - add a new patch') parser.add_config_file_option(option_name="meta-closes", dest="meta_closes", - help="Meta tags for the bts close commands, default is '%(meta-closes)s'") + help="Meta tags for the bts close commands, default is '%(meta-closes)s'") parser.add_option("-e", "--edit", action="store_true", dest="edit", default=False, help="edit commit message before committing") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", default=False, @@ -113,6 +114,7 @@ def main(argv): return retval + if __name__ == '__main__': sys.exit(main(sys.argv)) |