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`
# 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

View File

@ -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)

View File

@ -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

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|
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,