Skip to content

Commit 750fbbc

Browse files
committed
scripts: drop redundant argparser 'default' args
There is no need to provide a default when 'store_true' or 'store_false' action is used. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
1 parent 9181383 commit 750fbbc

File tree

15 files changed

+40
-45
lines changed

15 files changed

+40
-45
lines changed

gbp/scripts/buildpackage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,17 +353,17 @@ def build_parser(name, prefix=None):
353353
"alternative build tree related options")
354354

355355
parser.add_bool_conf_file_arg("--ignore-new", dest="ignore_new")
356-
parser.add_arg("--verbose", action="store_true", dest="verbose", default=False,
356+
parser.add_arg("--verbose", action="store_true", dest="verbose",
357357
help="verbose command execution")
358358
parser.add_conf_file_arg("--color", dest="color", type='tristate')
359359
parser.add_conf_file_arg("--color-scheme",
360360
dest="color_scheme")
361361
parser.add_conf_file_arg("--notify", dest="notify", type='tristate')
362-
tag_group.add_arg("--tag", action="store_true", dest="tag", default=False,
362+
tag_group.add_arg("--tag", action="store_true", dest="tag",
363363
help="create a tag after a successful build")
364-
tag_group.add_arg("--tag-only", action="store_true", dest="tag_only", default=False,
364+
tag_group.add_arg("--tag-only", action="store_true", dest="tag_only",
365365
help="don't build, only tag and run the posttag hook")
366-
tag_group.add_arg("--retag", action="store_true", dest="retag", default=False,
366+
tag_group.add_arg("--retag", action="store_true", dest="retag",
367367
help="don't fail if the tag already exists")
368368
tag_group.add_bool_conf_file_arg("--sign-tags", dest="sign_tags")
369369
tag_group.add_conf_file_arg("--keyid", dest="keyid")

gbp/scripts/buildpackage_rpm.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def build_parser(name, prefix=None, git_treeish=None):
324324
parser.add_bool_conf_file_arg("--ignore-new",
325325
dest="ignore_new")
326326
parser.add_arg("--verbose", action="store_true", dest="verbose",
327-
default=False, help="verbose command execution")
327+
help="verbose command execution")
328328
parser.add_conf_file_arg("--tmp-dir", dest="tmp_dir")
329329
parser.add_conf_file_arg("--color", dest="color",
330330
type='tristate')
@@ -337,13 +337,11 @@ def build_parser(name, prefix=None, git_treeish=None):
337337
parser.add_conf_file_arg("--native", dest="native",
338338
type='tristate')
339339
tag_group.add_arg("--tag", action="store_true", dest="tag",
340-
default=False,
341340
help="create a tag after a successful build")
342341
tag_group.add_arg("--tag-only", action="store_true", dest="tag_only",
343-
default=False,
344342
help="don't build, only tag and run the posttag hook")
345343
tag_group.add_arg("--retag", action="store_true", dest="retag",
346-
default=False, help="don't fail if the tag already exists")
344+
help="don't fail if the tag already exists")
347345
tag_group.add_bool_conf_file_arg("--sign-tags",
348346
dest="sign_tags")
349347
tag_group.add_conf_file_arg("--keyid", dest="keyid")

gbp/scripts/clone.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def build_parser(name):
109109
branch_group = parser.add_argument_group("branch options", "branch tracking and layout options")
110110
cmd_group = parser.add_argument_group("external command options", "how and when to invoke hooks")
111111

112-
branch_group.add_arg("--all", action="store_true", dest="all", default=False,
112+
branch_group.add_arg("--all", action="store_true", dest="all",
113113
help="track all branches, not only debian and upstream")
114114
branch_group.add_conf_file_arg("--upstream-branch", dest="upstream_branch")
115115
branch_group.add_conf_file_arg("--debian-branch", dest="debian_branch")
@@ -122,7 +122,7 @@ def build_parser(name):
122122
help="hook to run after cloning the source tree")
123123
cmd_group.add_bool_conf_file_arg("--hooks", dest="hooks")
124124

125-
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose", default=False,
125+
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose",
126126
help="verbose command execution")
127127
parser.add_conf_file_arg("--color", dest="color", type='tristate')
128128
parser.add_conf_file_arg("--color-scheme", dest="color_scheme")

gbp/scripts/create_remote_repo.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ def build_parser(name, sections=[]):
245245
parser.add_arg("-v", "--verbose",
246246
action="store_true",
247247
dest="verbose",
248-
default=False,
249248
help="verbose command execution")
250249
parser.add_conf_file_arg("--color",
251250
dest="color",

gbp/scripts/dch.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -352,36 +352,36 @@ def build_parser(name):
352352
help="expression to determine the next snapshot number")
353353
parser.add_conf_file_arg("--git-log", dest="git_log",
354354
help="options to pass to git-log")
355-
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose", default=False,
355+
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose",
356356
help="verbose command execution")
357357
parser.add_conf_file_arg("--color", dest="color", type='tristate')
358358
parser.add_conf_file_arg("--color-scheme", dest="color_scheme")
359359
range_group.add_arg("-s", "--since", dest="since", help="commit to start from (e.g. HEAD^^^, debian/0.4.3)")
360-
range_group.add_arg("-a", "--auto", action="store_true", dest="auto", default=False,
360+
range_group.add_arg("-a", "--auto", action="store_true", dest="auto",
361361
help="autocomplete changelog from last snapshot or tag")
362-
version_group.add_arg("-R", "--release", action="store_true", dest="release", default=False,
362+
version_group.add_arg("-R", "--release", action="store_true", dest="release",
363363
help="mark as release")
364-
version_group.add_arg("-S", "--snapshot", action="store_true", dest="snapshot", default=False,
364+
version_group.add_arg("-S", "--snapshot", action="store_true", dest="snapshot",
365365
help="mark as snapshot build")
366366
version_group.add_arg("-D", "--distribution", dest="distribution", help="Set distribution")
367-
version_group.add_arg("--force-distribution", action="store_true", dest="force_distribution", default=False,
367+
version_group.add_arg("--force-distribution", action="store_true", dest="force_distribution",
368368
help="Force the provided distribution to be used, "
369369
"even if it doesn't match the list of known distributions")
370370
version_group.add_arg("-N", "--new-version", dest="new_version",
371371
help="use this as base for the new version number")
372372
version_group.add_conf_file_arg("--urgency", dest="urgency")
373-
version_group.add_arg("--bpo", dest="bpo", action="store_true", default=False,
373+
version_group.add_arg("--bpo", dest="bpo", action="store_true",
374374
help="Increment the Debian release number for an upload to backports, "
375375
"and add a backport upload changelog comment.")
376-
version_group.add_arg("--nmu", dest="nmu", action="store_true", default=False,
376+
version_group.add_arg("--nmu", dest="nmu", action="store_true",
377377
help="Increment the Debian release number for a non-maintainer upload")
378-
version_group.add_arg("--qa", dest="qa", action="store_true", default=False,
378+
version_group.add_arg("--qa", dest="qa", action="store_true",
379379
help="Increment the Debian release number for a Debian QA Team upload, "
380380
"and add a QA upload changelog comment.")
381-
version_group.add_arg("--team", dest="team", action="store_true", default=False,
381+
version_group.add_arg("--team", dest="team", action="store_true",
382382
help="Increment the Debian release number for a Debian Team upload, "
383383
"and add a Team upload changelog comment.")
384-
version_group.add_arg("--security", dest="security", action="store_true", default=False,
384+
version_group.add_arg("--security", dest="security", action="store_true",
385385
help="Increment the Debian release number for a security upload and "
386386
"add a security upload changelog comment.")
387387
version_group.add_bool_conf_file_arg("--git-author", dest="use_git_author")
@@ -399,7 +399,7 @@ def build_parser(name):
399399
commit_group.add_conf_file_arg("--spawn-editor", dest="spawn_editor")
400400
parser.add_conf_file_arg("--commit-msg",
401401
dest="commit_msg")
402-
parser.add_arg("-c", "--commit", action="store_true", dest="commit", default=False,
402+
parser.add_arg("-c", "--commit", action="store_true", dest="commit",
403403
help="commit changelog file after generating")
404404
parser.add_conf_file_arg("--dch-opt", dest="dch_opts", action="append",
405405
help="option to pass to dch verbatim, "

gbp/scripts/export_orig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def build_parser(name):
276276
branch_group = parser.add_argument_group("branch options",
277277
"branch layout options")
278278

279-
parser.add_arg("--verbose", action="store_true", dest="verbose", default=False,
279+
parser.add_arg("--verbose", action="store_true", dest="verbose",
280280
help="verbose command execution")
281281
parser.add_conf_file_arg("--color", dest="color", type='tristate')
282282
parser.add_conf_file_arg("--color-scheme",

gbp/scripts/import_dsc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ def build_parser(name):
320320
branch_group = parser.add_argument_group("version and branch naming options",
321321
"version number and branch layout options")
322322

323-
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose", default=False,
323+
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose",
324324
help="verbose command execution")
325325
parser.add_conf_file_arg("--color", dest="color", type='tristate')
326326
parser.add_conf_file_arg("--color-scheme",
@@ -341,15 +341,15 @@ def build_parser(name):
341341
tag_group.add_conf_file_arg("--upstream-tag",
342342
dest="upstream_tag")
343343
tag_group.add_arg("--skip-debian-tag", dest="skip_debian_tag",
344-
action="store_true", default=False,
344+
action="store_true",
345345
help="Don't add a tag after importing the Debian patch")
346346

347347
import_group.add_conf_file_arg("--filter",
348348
dest="filters", action="append")
349349
import_group.add_bool_conf_file_arg("--pristine-tar",
350350
dest="pristine_tar")
351351
import_group.add_arg("--allow-same-version", action="store_true",
352-
dest="allow_same_version", default=False,
352+
dest="allow_same_version",
353353
help="allow import of already imported version")
354354
import_group.add_bool_conf_file_arg("--author-is-committer",
355355
dest="author_committer")
@@ -363,7 +363,7 @@ def build_parser(name):
363363
parser.add_conf_file_arg("--repo-email", dest="repo_email",
364364
choices=['DEBIAN', 'GIT'])
365365
parser.add_arg("--download", dest='download', action="store_true",
366-
default=False, help="Ignored. Accepted for compatibility.")
366+
help="Ignored. Accepted for compatibility.")
367367
parser.add_argument("package", metavar="PACKAGE",
368368
help="package to import")
369369
parser.add_argument("target_dir", metavar="TARGET_DIR", nargs="?",

gbp/scripts/import_orig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,15 +349,15 @@ def build_parser(name):
349349
dest='interactive')
350350
parser.add_bool_conf_file_arg("--rollback",
351351
dest="rollback")
352-
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose", default=False,
352+
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose",
353353
help="verbose command execution")
354354
parser.add_conf_file_arg("--color", dest="color", type='tristate')
355355
parser.add_conf_file_arg("--color-scheme",
356356
dest="color_scheme")
357357

358358
# Accepted for compatibility
359359
parser.add_arg("--download", dest='download', action="store_true",
360-
default=False, help="Ignored. Accepted for compatibility.")
360+
help="Ignored. Accepted for compatibility.")
361361

362362
src_group = parser.add_mutually_exclusive_group(required=True)
363363
src_group.add_arg("--uscan", action="store_true",

gbp/scripts/import_srpm.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def build_parser(name):
134134
"version number and branch layout options")
135135

136136
parser.add_arg("-v", "--verbose", action="store_true", dest="verbose",
137-
default=False, help="verbose command execution")
137+
help="verbose command execution")
138138
parser.add_conf_file_arg("--color", dest="color",
139139
type='tristate')
140140
parser.add_conf_file_arg("--color-scheme",
@@ -143,7 +143,7 @@ def build_parser(name):
143143
parser.add_conf_file_arg("--vendor", action="store",
144144
dest="vendor")
145145
parser.add_arg("--download", action="store_true", dest="download",
146-
default=False, help="download source package")
146+
help="download source package")
147147
branch_group.add_conf_file_arg("--packaging-branch",
148148
dest="packaging_branch")
149149
branch_group.add_conf_file_arg("--upstream-branch",
@@ -154,10 +154,9 @@ def build_parser(name):
154154
branch_group.add_bool_conf_file_arg("--create-missing-branches",
155155
dest="create_missing_branches")
156156
branch_group.add_arg("--orphan-packaging", action="store_true",
157-
dest="orphan_packaging", default=False,
157+
dest="orphan_packaging",
158158
help="The packaging branch doesn't base on upstream")
159-
branch_group.add_arg("--native", action="store_true",
160-
dest="native", default=False,
159+
branch_group.add_arg("--native", action="store_true", dest="native",
161160
help="This is a dist native package, no separate "
162161
"upstream branch")
163162

@@ -178,7 +177,7 @@ def build_parser(name):
178177
import_group.add_bool_conf_file_arg("--pristine-tar",
179178
dest="pristine_tar")
180179
import_group.add_arg("--allow-same-version", action="store_true",
181-
dest="allow_same_version", default=False,
180+
dest="allow_same_version",
182181
help="allow import of already imported version")
183182
import_group.add_bool_conf_file_arg("--author-is-committer",
184183
dest="author_is_committer")

gbp/scripts/pq.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,14 +412,14 @@ def build_parser(name):
412412
return None
413413

414414
# Add common arguments
415-
_parent.add_arg("-v", "--verbose", action="store_true", dest="verbose", default=False,
415+
_parent.add_arg("-v", "--verbose", action="store_true", dest="verbose",
416416
help="verbose command execution")
417417
_parent.add_conf_file_arg("--color", dest="color", type='tristate')
418418
_parent.add_conf_file_arg("--color-scheme",
419419
dest="color_scheme")
420420
_parent.add_conf_file_arg("--pq-from", dest="pq_from", choices=['DEBIAN', 'TAG'])
421421
_parent.add_conf_file_arg("--upstream-tag", dest="upstream_tag")
422-
_parent.add_arg("--force", dest="force", action="store_true", default=False,
422+
_parent.add_arg("--force", dest="force", action="store_true",
423423
help="in case of import even import if the branch already exists")
424424
_parent.add_conf_file_arg("--time-machine", dest="time_machine", type=int)
425425

0 commit comments

Comments
 (0)