From 80a5fdef0cb090f370022b10bbe1f8020076d93c Mon Sep 17 00:00:00 2001 From: Petr Korolev Date: Thu, 11 Jun 2015 16:35:38 +0300 Subject: [PATCH] This fixes #54. And fix #240 also. --- .rubocop_todo.yml | 8 ++++---- CHANGELOG.md | 8 ++++++++ lib/github_changelog_generator/generator/generator.rb | 4 ++-- lib/github_changelog_generator/parser.rb | 9 ++++++++- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0e98934..f62e871 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,13 +1,13 @@ # This configuration was generated by `rubocop --auto-gen-config` -# on 2015-05-26 16:00:55 +0300 using RuboCop version 0.31.0. +# on 2015-06-11 16:35:14 +0300 using RuboCop version 0.31.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 14 +# Offense count: 13 Metrics/AbcSize: - Max: 59 + Max: 63 # Offense count: 1 Metrics/CyclomaticComplexity: @@ -21,7 +21,7 @@ Metrics/PerceivedComplexity: Style/AccessorMethodName: Enabled: false -# Offense count: 8 +# Offense count: 10 Style/Documentation: Enabled: false diff --git a/CHANGELOG.md b/CHANGELOG.md index e037874..05bf30e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## [Unreleased](https://github.com/skywinder/github-changelog-generator/tree/HEAD) + +[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.5.0...HEAD) + +**Fixed bugs:** + +- Exclude and Include tags is broken [\#245](https://github.com/skywinder/github-changelog-generator/issues/245) + ## [1.5.0](https://github.com/skywinder/github-changelog-generator/tree/1.5.0) (2015-05-26) [Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.4.1...1.5.0) diff --git a/lib/github_changelog_generator/generator/generator.rb b/lib/github_changelog_generator/generator/generator.rb index 442891f..e6b4e6f 100644 --- a/lib/github_changelog_generator/generator/generator.rb +++ b/lib/github_changelog_generator/generator/generator.rb @@ -104,12 +104,12 @@ module GitHubChangelogGenerator issues.each do |dict| added = false dict.labels.each do |label| - if label.name == "bug" + if @options[:bug_labels].include? label.name bugs_a.push dict added = true next end - if label.name == "enhancement" + if @options[:enhancement_labels].include? label.name enhancement_a.push dict added = true next diff --git a/lib/github_changelog_generator/parser.rb b/lib/github_changelog_generator/parser.rb index 6750d85..22b7be9 100644 --- a/lib/github_changelog_generator/parser.rb +++ b/lib/github_changelog_generator/parser.rb @@ -86,6 +86,12 @@ module GitHubChangelogGenerator opts.on("--exclude-labels x,y,z", Array, 'Issues with the specified labels will be always excluded from changelog. Default is \'duplicate,question,invalid,wontfix\'') do |list| options[:exclude_labels] = list end + opts.on("--bug-labels x,y,z", Array, 'Issues with the specified labels will be always added to "Fixed bugs" section. Default is \'bug,Bug\'') do |list| + options[:bug_labels] = list + end + opts.on("--enhancement-labels x,y,z", Array, 'Issues with the specified labels will be always added to "Implemented enhancements" section. Default is \'enhancement,Enhancement\'') do |list| + options[:enhancement_labels] = list + end opts.on("--between-tags x,y,z", Array, "Change log will be filled only between specified tags") do |list| options[:between_tags] = list end @@ -138,7 +144,8 @@ module GitHubChangelogGenerator unreleased: true, unreleased_label: "Unreleased", compare_link: true, - include_labels: %w(bug enhancement), + enhancement_labels: %w(enhancement Enhancement), + bug_labels: %w(bug Bug), exclude_labels: %w(duplicate question invalid wontfix), max_issues: nil, simple_list: false,