This fixes #54. And fix #240 also.

This commit is contained in:
Petr Korolev 2015-06-11 16:35:38 +03:00
parent f7e9199841
commit 80a5fdef0c
4 changed files with 22 additions and 7 deletions

View File

@ -1,13 +1,13 @@
# This configuration was generated by `rubocop --auto-gen-config` # 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 # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again. # versions of RuboCop, may require this file to be generated again.
# Offense count: 14 # Offense count: 13
Metrics/AbcSize: Metrics/AbcSize:
Max: 59 Max: 63
# Offense count: 1 # Offense count: 1
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:
@ -21,7 +21,7 @@ Metrics/PerceivedComplexity:
Style/AccessorMethodName: Style/AccessorMethodName:
Enabled: false Enabled: false
# Offense count: 8 # Offense count: 10
Style/Documentation: Style/Documentation:
Enabled: false Enabled: false

View File

@ -1,5 +1,13 @@
# Change Log # 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) ## [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) [Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.4.1...1.5.0)

View File

@ -104,12 +104,12 @@ module GitHubChangelogGenerator
issues.each do |dict| issues.each do |dict|
added = false added = false
dict.labels.each do |label| dict.labels.each do |label|
if label.name == "bug" if @options[:bug_labels].include? label.name
bugs_a.push dict bugs_a.push dict
added = true added = true
next next
end end
if label.name == "enhancement" if @options[:enhancement_labels].include? label.name
enhancement_a.push dict enhancement_a.push dict
added = true added = true
next next

View File

@ -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| 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 options[:exclude_labels] = list
end 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| opts.on("--between-tags x,y,z", Array, "Change log will be filled only between specified tags") do |list|
options[:between_tags] = list options[:between_tags] = list
end end
@ -138,7 +144,8 @@ module GitHubChangelogGenerator
unreleased: true, unreleased: true,
unreleased_label: "Unreleased", unreleased_label: "Unreleased",
compare_link: true, 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), exclude_labels: %w(duplicate question invalid wontfix),
max_issues: nil, max_issues: nil,
simple_list: false, simple_list: false,