diff --git a/lib/github_changelog_generator/generator/entry.rb b/lib/github_changelog_generator/generator/entry.rb index 97a9241b7..27a54226e 100644 --- a/lib/github_changelog_generator/generator/entry.rb +++ b/lib/github_changelog_generator/generator/entry.rb @@ -123,6 +123,7 @@ def generate_body(pull_requests, issues) # @return [Array] Section objects. def default_sections [ + Section.new(name: "summary", prefix: @options[:summary_prefix], labels: @options[:summary_labels], options: @options, body_only:true), Section.new(name: "breaking", prefix: @options[:breaking_prefix], labels: @options[:breaking_labels], options: @options), Section.new(name: "enhancements", prefix: @options[:enhancement_prefix], labels: @options[:enhancement_labels], options: @options), Section.new(name: "bugs", prefix: @options[:bug_prefix], labels: @options[:bug_labels], options: @options), diff --git a/lib/github_changelog_generator/generator/section.rb b/lib/github_changelog_generator/generator/section.rb index 16958639b..905a49959 100644 --- a/lib/github_changelog_generator/generator/section.rb +++ b/lib/github_changelog_generator/generator/section.rb @@ -5,7 +5,7 @@ module GitHubChangelogGenerator # # @see GitHubChangelogGenerator::Entry class Section - attr_accessor :name, :prefix, :issues, :labels + attr_accessor :name, :prefix, :issues, :labels, :body_only def initialize(opts = {}) @name = opts[:name] @@ -13,6 +13,7 @@ def initialize(opts = {}) @labels = opts[:labels] || [] @issues = opts[:issues] || [] @options = opts[:options] || Options.new({}) + @body_only = opts[:body_only] || false end # Returns the content of a section. @@ -22,10 +23,11 @@ def generate_content content = "" if @issues.any? - content += "#{@prefix}\n\n" unless @options[:simple_list] + content += "#{@prefix}\n\n" unless @options[:simple_list] || @prefix.blank? @issues.each do |issue| merge_string = get_string_for_issue(issue) - content += "- #{merge_string}\n" + content += "- " unless @body_only + content += "#{merge_string}\n" end content += "\n" end @@ -53,6 +55,7 @@ def get_string_for_issue(issue) end def issue_line_with_body(line, issue) + return issue["body"] if @body_only && issue["body"].present? return line if !@options[:issue_line_body] || issue["body"].blank? # get issue body till first line break body_paragraph = body_till_first_break(issue["body"]) diff --git a/lib/github_changelog_generator/options.rb b/lib/github_changelog_generator/options.rb index 8370d9be3..dee313b90 100644 --- a/lib/github_changelog_generator/options.rb +++ b/lib/github_changelog_generator/options.rb @@ -63,6 +63,8 @@ class Options < SimpleDelegator simple_list since_tag ssl_ca_file + summary_labels + summary_prefix token unreleased unreleased_label diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 90a7f07b2..8d6704820 100755 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -56,6 +56,9 @@ def self.setup_parser(options) opts.on("-b", "--base [NAME]", "Optional base file to append generated changes to.") do |last| options[:base] = last end + opts.on("--summary-label [LABEL]", "Set up custom label for the release summary section. Default is \"\".") do |v| + options[:summary_prefix] = v + end opts.on("--breaking-label [LABEL]", "Set up custom label for the breaking changes section. Default is \"**Breaking changes:**\".") do |v| options[:breaking_prefix] = v end @@ -131,6 +134,9 @@ def self.setup_parser(options) opts.on("--exclude-labels x,y,z", Array, "Issues with the specified labels will be excluded from changelog. Default is 'duplicate,question,invalid,wontfix'.") do |list| options[:exclude_labels] = list end + opts.on("--summary-labels x,y,z", Array, 'Issues with these labels will be added to a new section, called "Release Summary". The section display only body of issues. Default is \'release-summary,summary\'.') do |list| + options[:summary_labels] = list + end opts.on("--breaking-labels x,y,z", Array, 'Issues with these labels will be added to a new section, called "Breaking changes". Default is \'backwards-incompatible,breaking\'.') do |list| options[:breaking_labels] = list end @@ -230,6 +236,7 @@ def self.default_options unreleased_label: "Unreleased", compare_link: true, exclude_labels: ["duplicate", "question", "invalid", "wontfix", "Duplicate", "Question", "Invalid", "Wontfix", "Meta: Exclude From Changelog"], + summary_labels: ["Release summary", "release-summary", "Summary", "summary"], breaking_labels: ["backwards-incompatible", "Backwards incompatible", "breaking"], enhancement_labels: ["enhancement", "Enhancement", "Type: Enhancement"], bug_labels: ["bug", "Bug", "Type: Bug"], @@ -246,6 +253,7 @@ def self.default_options header: "# Changelog", merge_prefix: "**Merged pull requests:**", issue_prefix: "**Closed issues:**", + summary_prefix: "", breaking_prefix: "**Breaking changes:**", enhancement_prefix: "**Implemented enhancements:**", bug_prefix: "**Fixed bugs:**", diff --git a/lib/github_changelog_generator/parser_file.rb b/lib/github_changelog_generator/parser_file.rb index 44044fafb..f6e91633d 100644 --- a/lib/github_changelog_generator/parser_file.rb +++ b/lib/github_changelog_generator/parser_file.rb @@ -67,7 +67,7 @@ def extract_pair(line) end KNOWN_ARRAY_KEYS = %i[exclude_labels include_labels - breaking_labels enhancement_labels bug_labels + summary_labels breaking_labels enhancement_labels bug_labels deprecated_labels removed_labels security_labels issue_line_labels between_tags exclude_tags] KNOWN_INTEGER_KEYS = [:max_issues] diff --git a/man/git-generate-changelog.1 b/man/git-generate-changelog.1 index 42431d98a..0fc5d4f78 100644 --- a/man/git-generate-changelog.1 +++ b/man/git-generate-changelog.1 @@ -1,7 +1,7 @@ .\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . -.TH "GIT\-GENERATE\-CHANGELOG" "1" "April 2018" "" "" +.TH "GIT\-GENERATE\-CHANGELOG" "1" "May 2018" "" "" . .SH "NAME" \fBgit\-generate\-changelog\fR \- Generate changelog from GitHub @@ -49,6 +49,12 @@ Output file\. To print to STDOUT instead, use blank as path\. Default is CHANGEL Optional base file to append generated changes to\. . .P +\-\-summary\-label [LABEL] +. +.P +Set up custom label for the release summary section\. Default is ""\. +. +.P \-\-breaking\-label [LABEL] . .P @@ -199,6 +205,12 @@ Of the labeled issues, only include the ones with the specified labels\. Issues with the specified labels will be excluded from changelog\. Default is \'duplicate,question,invalid,wontfix\'\. . .P +\-\-summary\-labels x,y,z +. +.P +Issues with these labels will be added to a new section, called "Release Summary"\. The section display only body of issues\. Default is \'Release summary,release\-summary,Summary,summary\'\. +. +.P \-\-breaking\-labels x,y,z . .P diff --git a/man/git-generate-changelog.1.html b/man/git-generate-changelog.1.html index 7256f37c0..298e7aea4 100644 --- a/man/git-generate-changelog.1.html +++ b/man/git-generate-changelog.1.html @@ -109,6 +109,10 @@

OPTIONS

Optional base file to append generated changes to.

+

--summary-label [LABEL]

+ +

Set up custom label for the release summary section. Default is "".

+

--breaking-label [LABEL]

Set up custom label for breaking changes section. Default is "Breaking changes:".

@@ -209,6 +213,10 @@

OPTIONS

Issues with the specified labels will be excluded from changelog. Default is 'duplicate,question,invalid,wontfix'.

+

--summary-labels x,y,z

+ +

Issues with these labels will be added to a new section, called "Release Summary". The section display only body of issues. Default is 'Release summary,release-summary,Summary,summary'.

+

--breaking-labels x,y,z

Issues with these labels will be added to a new section, called "Breaking changes". Default is 'backwards-incompatible,breaking'.

@@ -334,7 +342,7 @@

SEE ALSO

  1. -
  2. April 2018
  3. +
  4. May 2018
  5. git-generate-changelog(1)
diff --git a/man/git-generate-changelog.md b/man/git-generate-changelog.md index 473e82d69..2cbc27770 100644 --- a/man/git-generate-changelog.md +++ b/man/git-generate-changelog.md @@ -35,6 +35,10 @@ Automatically generate changelog from your tags, issues, labels and pull request Optional base file to append generated changes to. + --summary-label [LABEL] + + Set up custom label for the release summary section. Default is "". + --breaking-label [LABEL] Set up custom label for breaking changes section. Default is "**Breaking changes:**". @@ -135,6 +139,10 @@ Automatically generate changelog from your tags, issues, labels and pull request Issues with the specified labels will be excluded from changelog. Default is 'duplicate,question,invalid,wontfix'. + --summary-labels x,y,z + + Issues with these labels will be added to a new section, called "Release Summary". The section display only body of issues. Default is 'Release summary,release-summary,Summary,summary'. + --breaking-labels x,y,z Issues with these labels will be added to a new section, called "Breaking changes". Default is 'backwards-incompatible,breaking'. pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy