Commit 74b2e304 authored by Jelmer Vernooij's avatar Jelmer Vernooij

Add --update-changelog option to force updating of changelog.

parent 911ac596
lintian-brush (0.10) UNRELEASED; urgency=medium
* Add a (inefficient) --dry-run option. Closes: #915977
* Add --update-changelog option to force updating of changelog.
-- Jelmer Vernooij <jelmer@debian.org> Sat, 15 Dec 2018 17:18:50 +0000
......
......@@ -323,7 +323,7 @@ def only_changes_last_changelog_block(tree):
def run_lintian_fixer(local_tree, fixer, committer=None,
update_changelog=True):
update_changelog=None):
"""Run a lintian fixer on a tree.
Args:
......@@ -366,6 +366,10 @@ def run_lintian_fixer(local_tree, fixer, committer=None,
if not local_tree.has_changes():
raise NoChanges("Script didn't make any changes")
if update_changelog is None:
# Default to true. Perhaps do something more clever.
update_changelog = True
if update_changelog and only_changes_last_changelog_block(local_tree):
# If the script only changed the last entry in the changelog,
# don't update the changelog
......
......@@ -54,8 +54,11 @@ from . import ( # noqa: E402
def main(argv=None):
parser = argparse.ArgumentParser(prog='lintian-brush')
parser.add_argument(
'--no-update-changelog', action="store_true",
help="do not update the changelog")
'--no-update-changelog', action="store_false", default=None,
dest="update_changelog", help="do not update the changelog")
parser.add_argument(
'--update-changelog', action="store_true", dest="update_changelog",
help="force updating of the changelog", default=None)
parser.add_argument(
'--version', action='version', version='%(prog)s ' + version_string)
parser.add_argument(
......@@ -125,7 +128,7 @@ def main(argv=None):
try:
applied, failed = run_lintian_fixers(
wt, fixers,
update_changelog=(not args.no_update_changelog),
update_changelog=args.update_changelog,
verbose=args.verbose)
except NotDebianPackage:
note("%s: Not a debian package.", wt.basedir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment