From d66faebcff6033f170fb242edb00f46758db8449 Mon Sep 17 00:00:00 2001 From: Zoe Wang Date: Mon, 25 Jan 2021 11:35:51 -0800 Subject: [PATCH] Add documentation category in changelog --- scripts/changelog/writer.py | 4 ++++ scripts/new-change | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/changelog/writer.py b/scripts/changelog/writer.py index 2cc8b7945328..a1236f7032a3 100644 --- a/scripts/changelog/writer.py +++ b/scripts/changelog/writer.py @@ -29,6 +29,7 @@ def write_changes(self, changes): self.write_items_for_category(s, self.bugfixes, "Bugfixes") self.write_items_for_category(s, self.deprecations, "Deprecations") self.write_items_for_category(s, self.removals, "Removals") + self.write_items_for_category(s, self.documentations, "Documentations") self.write_contributors() def write_contributors(self): @@ -57,6 +58,7 @@ def reset_maps(self): self.bugfixes = {} self.deprecations = {} self.removals = {} + self.documentations = {} self.categories = set() def group_entries(self): @@ -117,6 +119,8 @@ def get_map_for_type(self, t): return self.deprecations elif t == 'removal': return self.removals + elif t == 'documentation': + return self.documentations else: raise Exception("Unknown entry type %s!" % t) diff --git a/scripts/new-change b/scripts/new-change index 5688eb0a0409..cfe8801319e3 100755 --- a/scripts/new-change +++ b/scripts/new-change @@ -16,7 +16,7 @@ To generate a new changelog entry:: This will open up a file in your editor (via the ``EDITOR`` env var). You'll see this template:: - # Type should be one of: feature, bugfix, deprecation, removal + # Type should be one of: feature, bugfix, deprecation, removal, documentation type: {change_type} # The marketing name of the service this change applies to @@ -53,7 +53,7 @@ CHANGES_DIR = os.path.join( ) CHANGE_PARTS = ['type', 'category', 'description'] TEMPLATE = """\ -# Type should be one of: feature, bugfix, deprecation, removal +# Type should be one of: feature, bugfix, deprecation, removal, documentation type: {change_type} # The marketing name of the service this change applies to @@ -189,7 +189,8 @@ def parse_filled_in_contents(contents): continue if 'type' not in parsed and line.startswith('type:'): t = line[len('type:'):].strip() - if t not in ['feature', 'bugfix', 'deprecation', 'removal']: + if t not in ['feature', 'bugfix', 'deprecation', 'removal', + 'documentation']: raise Exception("Unsupported category %s" % t) parsed['type'] = t elif 'category' not in parsed and line.startswith('category:'): @@ -210,7 +211,8 @@ def parse_filled_in_contents(contents): def main(): parser = argparse.ArgumentParser() parser.add_argument('-t', '--type', dest='change_type', - default='', choices=('bugfix', 'feature', 'deprecation')) + default='', choices=('bugfix', 'feature', + 'deprecation', 'documentation')) parser.add_argument('-c', '--category', dest='category', default='') parser.add_argument('-u', '--contributor', dest='contributor',