Compare commits
48 Commits
1.8.4
...
dlanileona
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
930372b572 | ||
|
|
6a1b4f553f | ||
|
|
23f4a79462 | ||
|
|
99ffa3692b | ||
|
|
8acfcd934f | ||
|
|
fdb89ea805 | ||
|
|
b7fff7b764 | ||
|
|
6d36d007ad | ||
|
|
693f5ee2ee | ||
|
|
e6eb9f5bb6 | ||
|
|
916df554af | ||
|
|
8f61c7fc7e | ||
|
|
d79e70b267 | ||
|
|
ba7c565374 | ||
|
|
31b4294ed6 | ||
|
|
55a1c6933c | ||
|
|
125960a3a3 | ||
|
|
9feecf98b8 | ||
|
|
4b88f02f97 | ||
|
|
eccecd6875 | ||
|
|
0862e54f42 | ||
|
|
1c578fec91 | ||
|
|
29c33fec60 | ||
|
|
6c71cf439a | ||
|
|
2d7f6bf174 | ||
|
|
1e4a3db0a2 | ||
|
|
b0fc03f38c | ||
|
|
a2658f9af9 | ||
|
|
48a49a67ec | ||
|
|
93b69a511f | ||
|
|
ef97e7f950 | ||
|
|
fbd8207ff4 | ||
|
|
ff4e5612af | ||
|
|
6bace8a582 | ||
|
|
a6b0d0cb83 | ||
|
|
91176e9174 | ||
|
|
494c8afff0 | ||
|
|
d14694a6d6 | ||
|
|
aa64fa131c | ||
|
|
fe0eab1c90 | ||
|
|
14d7c29808 | ||
|
|
1bf758480f | ||
|
|
12ea21c00b | ||
|
|
6411ba6b81 | ||
|
|
302eb9c66f | ||
|
|
4bd88a3fcb | ||
|
|
61b026a60c | ||
|
|
0df2687b93 |
@@ -14,3 +14,7 @@ Metrics/ClassLength:
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/MethodLength:
|
||||
Enabled: false
|
||||
|
||||
Style/FileName:
|
||||
Exclude:
|
||||
- 'bin/git-generate-changelog'
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
sudo: false
|
||||
cache: bundler
|
||||
language: ruby
|
||||
before_install: gem update --system
|
||||
rvm:
|
||||
- 2.1.0
|
||||
script:
|
||||
|
||||
26
CHANGELOG.md
26
CHANGELOG.md
@@ -1,5 +1,27 @@
|
||||
# Change Log
|
||||
|
||||
## [1.9.0](https://github.com/skywinder/github-changelog-generator/tree/1.9.0) (2015-09-17)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.5...1.9.0)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Feature: exclude\_tags using regular expression [\#281](https://github.com/skywinder/github-changelog-generator/pull/281) ([olleolleolle](https://github.com/olleolleolle))
|
||||
- Auto parse options from file .github\_changelog\_generator [\#278](https://github.com/skywinder/github-changelog-generator/pull/278) ([dlanileonardo](https://github.com/dlanileonardo))
|
||||
|
||||
## [1.8.5](https://github.com/skywinder/github-changelog-generator/tree/1.8.5) (2015-09-15)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.4...1.8.5)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Rake task: Be able to set false value in config [\#279](https://github.com/skywinder/github-changelog-generator/pull/279) ([olleolleolle](https://github.com/olleolleolle))
|
||||
|
||||
## [1.8.4](https://github.com/skywinder/github-changelog-generator/tree/1.8.4) (2015-09-01)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.3...1.8.4)
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- Sending OATH through -t fails [\#274](https://github.com/skywinder/github-changelog-generator/issues/274)
|
||||
|
||||
## [1.8.3](https://github.com/skywinder/github-changelog-generator/tree/1.8.3) (2015-08-31)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.2...1.8.3)
|
||||
|
||||
@@ -14,6 +36,10 @@
|
||||
|
||||
- Output should not include security information [\#270](https://github.com/skywinder/github-changelog-generator/issues/270)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- This PRi will fix \#274. [\#275](https://github.com/skywinder/github-changelog-generator/pull/275) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.8.1](https://github.com/skywinder/github-changelog-generator/tree/1.8.1) (2015-08-25)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.8.0...1.8.1)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
github_changelog_generator (1.8.1)
|
||||
github_changelog_generator (1.9.0)
|
||||
colorize (~> 0.7)
|
||||
github_api (~> 0.12)
|
||||
|
||||
|
||||
50
README.md
50
README.md
@@ -1,5 +1,5 @@
|
||||
[](http://badge.fury.io/rb/github_changelog_generator)
|
||||
[](https://gemnasium.com/skywinder/github-changelog-generator)
|
||||
[](https://gemnasium.com/skywinder/github-changelog-generator)
|
||||
[](https://travis-ci.org/skywinder/github-changelog-generator)
|
||||
[](http://inch-ci.org/github/skywinder/github-changelog-generator)
|
||||
[](https://codeclimate.com/github/skywinder/github-changelog-generator)
|
||||
@@ -20,7 +20,7 @@ GitHub Changelog Generator 
|
||||
- [Contributing](#contributing)
|
||||
- [License](#license)
|
||||
|
||||
|
||||
|
||||
### Changelog generation has never been so easy:
|
||||
|
||||
**Fully automate changelog generation** - This gem generates change log file based on **tags**, **issues** and merged **pull requests** (and splits them into separate lists according labels) from :octocat: GitHub Issue Tracker.
|
||||
@@ -48,26 +48,26 @@ Because software tools are for people. If you don’t care, why are you contribu
|
||||
- In general it looks like this:
|
||||
|
||||
> ## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5) (2015-01-15)
|
||||
>
|
||||
>
|
||||
> [Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
|
||||
>
|
||||
>
|
||||
> **Implemented enhancements:**
|
||||
>
|
||||
>
|
||||
> - Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
|
||||
>
|
||||
>
|
||||
> **Fixed bugs:**
|
||||
>
|
||||
>
|
||||
> - Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
|
||||
>
|
||||
>
|
||||
> **Merged pull requests:**
|
||||
>
|
||||
>
|
||||
> - PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
|
||||
>
|
||||
>
|
||||
> - support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
||||
|
||||
|
||||
## Usage
|
||||
**It's really simple**:
|
||||
**It's really simple**:
|
||||
|
||||
- If your **git remote** `origin` refers to your GitHub repo, then just go to your project folder and run:
|
||||
|
||||
@@ -76,7 +76,7 @@ Because software tools are for people. If you don’t care, why are you contribu
|
||||
- or from anywhere:
|
||||
- `github_changelog_generator -u github_username -p github_project`
|
||||
- `github_changelog_generator github_username/github_project`
|
||||
|
||||
|
||||
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
||||
|
||||
### Params
|
||||
@@ -84,6 +84,16 @@ Type `github_changelog_generator --help` for details.
|
||||
|
||||
More detailed info about params you can find in Wiki page: [**Advanced change log generation examples**](https://github.com/skywinder/github-changelog-generator/wiki/Advanced-change-log-generation-examples)
|
||||
|
||||
### Params File
|
||||
You can put Params in a .github_changelog_generator file in Project Root to override default params:
|
||||
|
||||
Example:
|
||||
```
|
||||
unreleased=false
|
||||
future-release=5.0.0
|
||||
since-tag=1.0.0
|
||||
```
|
||||
|
||||
### GitHub token
|
||||
|
||||
Since GitHub allows you to make only 50 requests without authentication it's recommended to run this script with a token (`-t, --token` option)
|
||||
@@ -92,9 +102,9 @@ Since GitHub allows you to make only 50 requests without authentication it's rec
|
||||
|
||||
And:
|
||||
|
||||
- Run with key `-t [your-40-digit-token]`
|
||||
- Or set environment variable `CHANGELOG_GITHUB_TOKEN` and specify there your token.
|
||||
|
||||
- Run with key `-t [your-40-digit-token]`
|
||||
- Or set environment variable `CHANGELOG_GITHUB_TOKEN` and specify there your token.
|
||||
|
||||
i.e. add to your `~/.bash_profile` or `~/.zshrc` or any other place to load ENV variables string :
|
||||
|
||||
export CHANGELOG_GITHUB_TOKEN="your-40-digit-github-token"
|
||||
@@ -139,10 +149,10 @@ All command line options can be passed to the Rake task as `config` parameters.
|
||||
- Merged pull requests (all `merged` pull-requests) :twisted_rightwards_arrows:
|
||||
- Bug fixes (by label `bug` in issue) :beetle:
|
||||
- Enhancements (by label `enhancement` in issue) :star2:
|
||||
- Issues (closed issues `w/o any labels`) :non-potable_water:
|
||||
- Issues (closed issues `w/o any labels`) :non-potable_water:
|
||||
|
||||
- You can manually set which labels should be included/excluded. :wrench:
|
||||
- Apply a lot of other customisations, to fit changelog for your personal style :tophat:
|
||||
- Apply a lot of other customisations, to fit changelog for your personal style :tophat:
|
||||
(*look `github_changelog_generator --help` for details)*
|
||||
|
||||
|
||||
@@ -153,7 +163,7 @@ Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Ch
|
||||
|
||||
|
||||
### Projects using this library
|
||||
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
|
||||
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
|
||||
|
||||
If you've used this project in a live app, please let me know! Nothing makes me happier than seeing someone else take my work and go wild with it.
|
||||
|
||||
@@ -161,9 +171,9 @@ If you've used this project in a live app, please let me know! Nothing makes me
|
||||
|
||||
## Am I missing some essential feature?
|
||||
|
||||
- **Nothing is impossible!**
|
||||
- **Nothing is impossible!**
|
||||
|
||||
- Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together!
|
||||
- Open an [issue](https://github.com/skywinder/Github-Changelog-Generator/issues/new) and let's make generator better together!
|
||||
|
||||
- *Bug reports, feature requests, patches, well-wishes are always welcome* :heavy_exclamation_mark:
|
||||
|
||||
|
||||
4
bin/git-generate-changelog
Executable file
4
bin/git-generate-changelog
Executable file
@@ -0,0 +1,4 @@
|
||||
#! /usr/bin/env ruby
|
||||
|
||||
require_relative "../lib/github_changelog_generator"
|
||||
GitHubChangelogGenerator::ChangelogGenerator.new.run
|
||||
10
ext/mkrf_conf.rb
Normal file
10
ext/mkrf_conf.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
PREFIX = "/usr/local"
|
||||
MANPREFIX = "#{PREFIX}/share/man/man1"
|
||||
MAN_PAGES = "man/git-*"
|
||||
|
||||
require "fileutils"
|
||||
|
||||
Dir.glob(MAN_PAGES).each do |f|
|
||||
filename = File.basename(f)
|
||||
FileUtils.cp(f, "#{MANPREFIX}/#{filename}")
|
||||
end
|
||||
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
||||
spec.description = "Changelog generation has never been so easy. Fully automate changelog generation - this gem generate change log file based on tags, issues and merged pull requests from Github issue tracker."
|
||||
spec.homepage = "https://github.com/skywinder/Github-Changelog-Generator"
|
||||
spec.license = "MIT"
|
||||
spec.extensions = "ext/mkrf_conf.rb"
|
||||
|
||||
spec.files = `git ls-files -z`.split("\x0")
|
||||
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
||||
|
||||
@@ -7,6 +7,7 @@ require "benchmark"
|
||||
|
||||
require_relative "github_changelog_generator/helper"
|
||||
require_relative "github_changelog_generator/parser"
|
||||
require_relative "github_changelog_generator/parser_file"
|
||||
require_relative "github_changelog_generator/generator/generator"
|
||||
require_relative "github_changelog_generator/version"
|
||||
require_relative "github_changelog_generator/reader"
|
||||
|
||||
@@ -131,16 +131,45 @@ module GitHubChangelogGenerator
|
||||
# @param [Array] all_tags all tags
|
||||
# @return [Array] filtered tags according :exclude_tags option
|
||||
def filter_excluded_tags(all_tags)
|
||||
filtered_tags = all_tags
|
||||
if @options[:exclude_tags]
|
||||
@options[:exclude_tags].each do |tag|
|
||||
unless all_tags.map(&:name).include? tag
|
||||
Helper.log.warn "Warning: can't find tag #{tag}, specified with --exclude-tags option."
|
||||
end
|
||||
end
|
||||
filtered_tags = all_tags.reject { |tag| @options[:exclude_tags].include? tag.name }
|
||||
return all_tags unless @options[:exclude_tags]
|
||||
|
||||
apply_exclude_tags(all_tags)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def apply_exclude_tags(all_tags)
|
||||
if @options[:exclude_tags].is_a?(Regexp)
|
||||
filter_tags_with_regex(all_tags)
|
||||
else
|
||||
filter_exact_tags(all_tags)
|
||||
end
|
||||
end
|
||||
|
||||
def filter_tags_with_regex(all_tags)
|
||||
warn_if_nonmatching_regex(all_tags)
|
||||
all_tags.reject { |tag| @options[:exclude_tags] =~ tag.name }
|
||||
end
|
||||
|
||||
def filter_exact_tags(all_tags)
|
||||
@options[:exclude_tags].each do |tag|
|
||||
warn_if_tag_not_found(all_tags, tag)
|
||||
end
|
||||
all_tags.reject { |tag| @options[:exclude_tags].include? tag.name }
|
||||
end
|
||||
|
||||
def warn_if_nonmatching_regex(all_tags)
|
||||
unless all_tags.map(&:name).any? { |t| @options[:exclude_tags] =~ t }
|
||||
Helper.log.warn "Warning: unable to reject any tag, using regex "\
|
||||
"#{@options[:exclude_tags].inspect} in --exclude-tags "\
|
||||
"option."
|
||||
end
|
||||
end
|
||||
|
||||
def warn_if_tag_not_found(all_tags, tag)
|
||||
unless all_tags.map(&:name).include? tag
|
||||
Helper.log.warn "Warning: can't find tag #{tag}, specified with --exclude-tags option."
|
||||
end
|
||||
filtered_tags
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,8 +9,10 @@ module GitHubChangelogGenerator
|
||||
def self.parse_options
|
||||
options = get_default_options
|
||||
|
||||
parser = setup_parser(options)
|
||||
parser_file = ParserFile.new options
|
||||
parser_file.parse!
|
||||
|
||||
parser = setup_parser(options)
|
||||
parser.parse!
|
||||
|
||||
if options[:user].nil? || options[:project].nil?
|
||||
|
||||
37
lib/github_changelog_generator/parser_file.rb
Normal file
37
lib/github_changelog_generator/parser_file.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
module GitHubChangelogGenerator
|
||||
class ParserFile
|
||||
def initialize(options)
|
||||
@options = options
|
||||
end
|
||||
|
||||
def parse!
|
||||
return unless File.exist?(file)
|
||||
|
||||
File.readlines(file).each { |line| parse_line!(line) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def file
|
||||
@file ||= File.expand_path(@options[:params_file] || ".github_changelog_generator")
|
||||
end
|
||||
|
||||
def parse_line!(line)
|
||||
key_sym, value = extract_pair(line)
|
||||
value = true if value =~ (/^(true|t|yes|y|1)$/i)
|
||||
value = false if value =~ (/^(false|f|no|n|0)$/i)
|
||||
@options[key_sym] = value
|
||||
rescue
|
||||
raise "Config file #{file} is incorrect in line \"#{line.gsub(/[\n\r]+/, '')}\""
|
||||
end
|
||||
|
||||
# Returns a the setting as a symbol and its string value sans newlines.
|
||||
#
|
||||
# @param line [String] unparsed line from config file
|
||||
# @return [Array<Symbol, String>]
|
||||
def extract_pair(line)
|
||||
key, value = line.split("=", 2)
|
||||
[key.sub("-", "_").to_sym, value.gsub(/[\n\r]+/, "")]
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -16,7 +16,7 @@ module GitHubChangelogGenerator
|
||||
bug_labels enhancement_labels
|
||||
between_tags exclude_tags since_tag max_issues
|
||||
github_site github_endpoint simple_list
|
||||
future_release verbose release_url )
|
||||
future_release verbose release_url base )
|
||||
|
||||
OPTIONS.each do |o|
|
||||
attr_accessor o.to_sym
|
||||
@@ -51,7 +51,7 @@ module GitHubChangelogGenerator
|
||||
|
||||
OPTIONS.each do |o|
|
||||
v = instance_variable_get("@#{o}")
|
||||
options[o.to_sym] = v if v
|
||||
options[o.to_sym] = v unless v.nil?
|
||||
end
|
||||
|
||||
generator = Generator.new options
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module GitHubChangelogGenerator
|
||||
VERSION = "1.8.4"
|
||||
VERSION = "1.9.0"
|
||||
end
|
||||
|
||||
252
man/git-generate-changelog.1
Normal file
252
man/git-generate-changelog.1
Normal file
@@ -0,0 +1,252 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "GIT\-GENERATE\-CHANGELOG" "1" "October 2015" "" ""
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBgit\-generate\-changelog\fR \- Generate changelog from github
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
\fBgit generate\-changelog\fR [\-h|\-\-help] [\-u|\-\-user] [\-p|\-\-project]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Automatically generate change log from your tags, issues, labels and pull requests on GitHub\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
\-u, \-\-user [USER]
|
||||
.
|
||||
.P
|
||||
Username of the owner of target GitHub repo
|
||||
.
|
||||
.P
|
||||
\-p, \-\-project [PROJECT]
|
||||
.
|
||||
.P
|
||||
Name of project on GitHub
|
||||
.
|
||||
.P
|
||||
\-t, \-\-token [TOKEN]
|
||||
.
|
||||
.P
|
||||
To make more than 50 requests per hour your GitHub token is required\. You can generate it at: https://github\.com/settings/tokens/new
|
||||
.
|
||||
.P
|
||||
\-f, \-\-date\-format [FORMAT]
|
||||
.
|
||||
.P
|
||||
Date format\. Default is %Y\-%m\-%d
|
||||
.
|
||||
.P
|
||||
\-o, \-\-output [NAME]
|
||||
.
|
||||
.P
|
||||
Output file\. Default is CHANGELOG\.md
|
||||
.
|
||||
.P
|
||||
\-b, \-\-base [NAME]
|
||||
.
|
||||
.P
|
||||
Optional base file to append generated changes to\.
|
||||
.
|
||||
.P
|
||||
\-\-bugs\-label [LABEL]
|
||||
.
|
||||
.P
|
||||
Setup custom label for bug\-fixes section\. Default is "\fBFixed bugs:\fR
|
||||
.
|
||||
.P
|
||||
\-\-enhancement\-label [LABEL]
|
||||
.
|
||||
.P
|
||||
Setup custom label for enhancements section\. Default is "\fBImplemented enhancements:\fR"
|
||||
.
|
||||
.P
|
||||
\-\-issues\-label [LABEL]
|
||||
.
|
||||
.P
|
||||
Setup custom label for closed\-issues section\. Default is "\fBClosed issues:\fR"
|
||||
.
|
||||
.P
|
||||
\-\-header\-label [LABEL]
|
||||
.
|
||||
.P
|
||||
Setup custom header label\. Default is "# Change Log"
|
||||
.
|
||||
.P
|
||||
\-\-pr\-label [LABEL]
|
||||
.
|
||||
.P
|
||||
Setup custom label for pull requests section\. Default is "\fBMerged pull requests:\fR"
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]issues
|
||||
.
|
||||
.P
|
||||
Include closed issues in changelog\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]issues\-wo\-labels
|
||||
.
|
||||
.P
|
||||
Include closed issues without labels in changelog\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]pr\-wo\-labels
|
||||
.
|
||||
.P
|
||||
Include pull requests without labels in changelog\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]pull\-requests
|
||||
.
|
||||
.P
|
||||
Include pull\-requests in changelog\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]filter\-by\-milestone
|
||||
.
|
||||
.P
|
||||
Use milestone to detect when issue was resolved\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]author
|
||||
.
|
||||
.P
|
||||
Add author of pull\-request in the end\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-unreleased\-only
|
||||
.
|
||||
.P
|
||||
Generate log from unreleased closed issues only\.
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]unreleased
|
||||
.
|
||||
.P
|
||||
Add to log unreleased closed issues\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-unreleased\-label [label]
|
||||
.
|
||||
.P
|
||||
Add to log unreleased closed issues\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]compare\-link
|
||||
.
|
||||
.P
|
||||
Include compare link (Full Changelog) between older version and newer version\. Default is true
|
||||
.
|
||||
.P
|
||||
\-\-include\-labels x,y,z
|
||||
.
|
||||
.P
|
||||
Only issues with the specified labels will be included in the changelog\.
|
||||
.
|
||||
.P
|
||||
\-\-exclude\-labels x,y,z
|
||||
.
|
||||
.P
|
||||
Issues with the specified labels will be always excluded from changelog\. Default is \'duplicate,question,invalid,wontfix\'
|
||||
.
|
||||
.P
|
||||
\-\-bug\-labels x,y,z
|
||||
.
|
||||
.P
|
||||
Issues with the specified labels will be always added to "Fixed bugs" section\. Default is \'bug,Bug\'
|
||||
.
|
||||
.P
|
||||
\-\-enhancement\-labels x,y,z
|
||||
.
|
||||
.P
|
||||
Issues with the specified labels will be always added to "Implemented enhancements" section\. Default is \'enhancement,Enhancement\'
|
||||
.
|
||||
.P
|
||||
\-\-between\-tags x,y,z
|
||||
.
|
||||
.P
|
||||
Change log will be filled only between specified tags
|
||||
.
|
||||
.P
|
||||
\-\-exclude\-tags x,y,z
|
||||
.
|
||||
.P
|
||||
Change log will exclude specified tags
|
||||
.
|
||||
.P
|
||||
\-\-since\-tag x
|
||||
.
|
||||
.P
|
||||
Change log will start after specified tag
|
||||
.
|
||||
.P
|
||||
\-\-due\-tag x
|
||||
.
|
||||
.P
|
||||
Change log will end before specified tag
|
||||
.
|
||||
.P
|
||||
\-\-max\-issues [NUMBER]
|
||||
.
|
||||
.P
|
||||
Max number of issues to fetch from GitHub\. Default is unlimited
|
||||
.
|
||||
.P
|
||||
\-\-release\-url [URL]
|
||||
.
|
||||
.P
|
||||
The URL to point to for release links, in printf format (with the tag as variable)\.
|
||||
.
|
||||
.P
|
||||
\-\-github\-site [URL]
|
||||
.
|
||||
.P
|
||||
The Enterprise Github site on which your project is hosted\.
|
||||
.
|
||||
.P
|
||||
\-\-github\-api [URL]
|
||||
.
|
||||
.P
|
||||
The enterprise endpoint to use for your Github API\.
|
||||
.
|
||||
.P
|
||||
\-\-simple\-list
|
||||
.
|
||||
.P
|
||||
Create simple list from issues and pull requests\. Default is false\.
|
||||
.
|
||||
.P
|
||||
\-\-future\-release [RELEASE\-VERSION]
|
||||
.
|
||||
.P
|
||||
Put the unreleased changes in the specified release number\.
|
||||
.
|
||||
.P
|
||||
\-\-[no\-]verbose
|
||||
.
|
||||
.P
|
||||
Run verbosely\. Default is true
|
||||
.
|
||||
.P
|
||||
\-v, \-\-version
|
||||
.
|
||||
.P
|
||||
Print version number
|
||||
.
|
||||
.P
|
||||
\-h, \-\-help
|
||||
.
|
||||
.P
|
||||
Displays Help
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
.
|
||||
.SH "AUTHOR"
|
||||
Written by Petr Korolev sky4winder@gmail\.com
|
||||
.
|
||||
.SH "REPORTING BUGS"
|
||||
<\fIhttps://github\.com/skywinder/github\-changelog\-generator/issues\fR>
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
<\fIhttps://github\.com/skywinder/github\-changelog\-generator/\fR>
|
||||
262
man/git-generate-changelog.html
Normal file
262
man/git-generate-changelog.html
Normal file
@@ -0,0 +1,262 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv='content-type' value='text/html;charset=utf8'>
|
||||
<meta name='generator' value='Ronn/v0.7.3 (http://github.com/rtomayko/ronn/tree/0.7.3)'>
|
||||
<title>git-generate-changelog(1) - Generate changelog from github</title>
|
||||
<style type='text/css' media='all'>
|
||||
/* style: man */
|
||||
body#manpage {margin:0}
|
||||
.mp {max-width:100ex;padding:0 9ex 1ex 4ex}
|
||||
.mp p,.mp pre,.mp ul,.mp ol,.mp dl {margin:0 0 20px 0}
|
||||
.mp h2 {margin:10px 0 0 0}
|
||||
.mp > p,.mp > pre,.mp > ul,.mp > ol,.mp > dl {margin-left:8ex}
|
||||
.mp h3 {margin:0 0 0 4ex}
|
||||
.mp dt {margin:0;clear:left}
|
||||
.mp dt.flush {float:left;width:8ex}
|
||||
.mp dd {margin:0 0 0 9ex}
|
||||
.mp h1,.mp h2,.mp h3,.mp h4 {clear:left}
|
||||
.mp pre {margin-bottom:20px}
|
||||
.mp pre+h2,.mp pre+h3 {margin-top:22px}
|
||||
.mp h2+pre,.mp h3+pre {margin-top:5px}
|
||||
.mp img {display:block;margin:auto}
|
||||
.mp h1.man-title {display:none}
|
||||
.mp,.mp code,.mp pre,.mp tt,.mp kbd,.mp samp,.mp h3,.mp h4 {font-family:monospace;font-size:14px;line-height:1.42857142857143}
|
||||
.mp h2 {font-size:16px;line-height:1.25}
|
||||
.mp h1 {font-size:20px;line-height:2}
|
||||
.mp {text-align:justify;background:#fff}
|
||||
.mp,.mp code,.mp pre,.mp pre code,.mp tt,.mp kbd,.mp samp {color:#131211}
|
||||
.mp h1,.mp h2,.mp h3,.mp h4 {color:#030201}
|
||||
.mp u {text-decoration:underline}
|
||||
.mp code,.mp strong,.mp b {font-weight:bold;color:#131211}
|
||||
.mp em,.mp var {font-style:italic;color:#232221;text-decoration:none}
|
||||
.mp a,.mp a:link,.mp a:hover,.mp a code,.mp a pre,.mp a tt,.mp a kbd,.mp a samp {color:#0000ff}
|
||||
.mp b.man-ref {font-weight:normal;color:#434241}
|
||||
.mp pre {padding:0 4ex}
|
||||
.mp pre code {font-weight:normal;color:#434241}
|
||||
.mp h2+pre,h3+pre {padding-left:0}
|
||||
ol.man-decor,ol.man-decor li {margin:3px 0 10px 0;padding:0;float:left;width:33%;list-style-type:none;text-transform:uppercase;color:#999;letter-spacing:1px}
|
||||
ol.man-decor {width:100%}
|
||||
ol.man-decor li.tl {text-align:left}
|
||||
ol.man-decor li.tc {text-align:center;letter-spacing:4px}
|
||||
ol.man-decor li.tr {text-align:right;float:right}
|
||||
</style>
|
||||
</head>
|
||||
<!--
|
||||
The following styles are deprecated and will be removed at some point:
|
||||
div#man, div#man ol.man, div#man ol.head, div#man ol.man.
|
||||
|
||||
The .man-page, .man-decor, .man-head, .man-foot, .man-title, and
|
||||
.man-navigation should be used instead.
|
||||
-->
|
||||
<body id='manpage'>
|
||||
<div class='mp' id='man'>
|
||||
|
||||
<div class='man-navigation' style='display:none'>
|
||||
<a href="#NAME">NAME</a>
|
||||
<a href="#SYNOPSIS">SYNOPSIS</a>
|
||||
<a href="#DESCRIPTION">DESCRIPTION</a>
|
||||
<a href="#OPTIONS">OPTIONS</a>
|
||||
<a href="#EXAMPLES">EXAMPLES</a>
|
||||
<a href="#AUTHOR">AUTHOR</a>
|
||||
<a href="#REPORTING-BUGS">REPORTING BUGS</a>
|
||||
<a href="#SEE-ALSO">SEE ALSO</a>
|
||||
</div>
|
||||
|
||||
<ol class='man-decor man-head man head'>
|
||||
<li class='tl'>git-generate-changelog(1)</li>
|
||||
<li class='tc'></li>
|
||||
<li class='tr'>git-generate-changelog(1)</li>
|
||||
</ol>
|
||||
|
||||
<h2 id="NAME">NAME</h2>
|
||||
<p class="man-name">
|
||||
<code>git-generate-changelog</code> - <span class="man-whatis">Generate changelog from github</span>
|
||||
</p>
|
||||
|
||||
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
||||
|
||||
<p><code>git generate-changelog</code> [-h|--help] [-u|--user] [-p|--project]</p>
|
||||
|
||||
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
||||
|
||||
<p>Automatically generate change log from your tags, issues, labels and pull requests on GitHub.</p>
|
||||
|
||||
<h2 id="OPTIONS">OPTIONS</h2>
|
||||
|
||||
<p> -u, --user [USER]</p>
|
||||
|
||||
<p> Username of the owner of target GitHub repo</p>
|
||||
|
||||
<p> -p, --project [PROJECT]</p>
|
||||
|
||||
<p> Name of project on GitHub</p>
|
||||
|
||||
<p> -t, --token [TOKEN]</p>
|
||||
|
||||
<p> To make more than 50 requests per hour your GitHub token is required. You can generate it at: https://github.com/settings/tokens/new</p>
|
||||
|
||||
<p> -f, --date-format [FORMAT]</p>
|
||||
|
||||
<p> Date format. Default is %Y-%m-%d</p>
|
||||
|
||||
<p> -o, --output [NAME]</p>
|
||||
|
||||
<p> Output file. Default is CHANGELOG.md</p>
|
||||
|
||||
<p> -b, --base [NAME]</p>
|
||||
|
||||
<p> Optional base file to append generated changes to.</p>
|
||||
|
||||
<p> --bugs-label [LABEL]</p>
|
||||
|
||||
<p> Setup custom label for bug-fixes section. Default is "<strong>Fixed bugs:</strong></p>
|
||||
|
||||
<p> --enhancement-label [LABEL]</p>
|
||||
|
||||
<p> Setup custom label for enhancements section. Default is "<strong>Implemented enhancements:</strong>"</p>
|
||||
|
||||
<p> --issues-label [LABEL]</p>
|
||||
|
||||
<p> Setup custom label for closed-issues section. Default is "<strong>Closed issues:</strong>"</p>
|
||||
|
||||
<p> --header-label [LABEL]</p>
|
||||
|
||||
<p> Setup custom header label. Default is "# Change Log"</p>
|
||||
|
||||
<p> --pr-label [LABEL]</p>
|
||||
|
||||
<p> Setup custom label for pull requests section. Default is "<strong>Merged pull requests:</strong>"</p>
|
||||
|
||||
<p> --[no-]issues</p>
|
||||
|
||||
<p> Include closed issues in changelog. Default is true</p>
|
||||
|
||||
<p> --[no-]issues-wo-labels</p>
|
||||
|
||||
<p> Include closed issues without labels in changelog. Default is true</p>
|
||||
|
||||
<p> --[no-]pr-wo-labels</p>
|
||||
|
||||
<p> Include pull requests without labels in changelog. Default is true</p>
|
||||
|
||||
<p> --[no-]pull-requests</p>
|
||||
|
||||
<p> Include pull-requests in changelog. Default is true</p>
|
||||
|
||||
<p> --[no-]filter-by-milestone</p>
|
||||
|
||||
<p> Use milestone to detect when issue was resolved. Default is true</p>
|
||||
|
||||
<p> --[no-]author</p>
|
||||
|
||||
<p> Add author of pull-request in the end. Default is true</p>
|
||||
|
||||
<p> --unreleased-only</p>
|
||||
|
||||
<p> Generate log from unreleased closed issues only.</p>
|
||||
|
||||
<p> --[no-]unreleased</p>
|
||||
|
||||
<p> Add to log unreleased closed issues. Default is true</p>
|
||||
|
||||
<p> --unreleased-label [label]</p>
|
||||
|
||||
<p> Add to log unreleased closed issues. Default is true</p>
|
||||
|
||||
<p> --[no-]compare-link</p>
|
||||
|
||||
<p> Include compare link (Full Changelog) between older version and newer version. Default is true</p>
|
||||
|
||||
<p> --include-labels x,y,z</p>
|
||||
|
||||
<p> Only issues with the specified labels will be included in the changelog.</p>
|
||||
|
||||
<p> --exclude-labels x,y,z</p>
|
||||
|
||||
<p> Issues with the specified labels will be always excluded from changelog. Default is 'duplicate,question,invalid,wontfix'</p>
|
||||
|
||||
<p> --bug-labels x,y,z</p>
|
||||
|
||||
<p> Issues with the specified labels will be always added to "Fixed bugs" section. Default is 'bug,Bug'</p>
|
||||
|
||||
<p> --enhancement-labels x,y,z</p>
|
||||
|
||||
<p> Issues with the specified labels will be always added to "Implemented enhancements" section. Default is 'enhancement,Enhancement'</p>
|
||||
|
||||
<p> --between-tags x,y,z</p>
|
||||
|
||||
<p> Change log will be filled only between specified tags</p>
|
||||
|
||||
<p> --exclude-tags x,y,z</p>
|
||||
|
||||
<p> Change log will exclude specified tags</p>
|
||||
|
||||
<p> --since-tag x</p>
|
||||
|
||||
<p> Change log will start after specified tag</p>
|
||||
|
||||
<p> --due-tag x</p>
|
||||
|
||||
<p> Change log will end before specified tag</p>
|
||||
|
||||
<p> --max-issues [NUMBER]</p>
|
||||
|
||||
<p> Max number of issues to fetch from GitHub. Default is unlimited</p>
|
||||
|
||||
<p> --release-url [URL]</p>
|
||||
|
||||
<p> The URL to point to for release links, in printf format (with the tag as variable).</p>
|
||||
|
||||
<p> --github-site [URL]</p>
|
||||
|
||||
<p> The Enterprise Github site on which your project is hosted.</p>
|
||||
|
||||
<p> --github-api [URL]</p>
|
||||
|
||||
<p> The enterprise endpoint to use for your Github API.</p>
|
||||
|
||||
<p> --simple-list</p>
|
||||
|
||||
<p> Create simple list from issues and pull requests. Default is false.</p>
|
||||
|
||||
<p> --future-release [RELEASE-VERSION]</p>
|
||||
|
||||
<p> Put the unreleased changes in the specified release number.</p>
|
||||
|
||||
<p> --[no-]verbose</p>
|
||||
|
||||
<p> Run verbosely. Default is true</p>
|
||||
|
||||
<p> -v, --version</p>
|
||||
|
||||
<p> Print version number</p>
|
||||
|
||||
<p> -h, --help</p>
|
||||
|
||||
<p> Displays Help</p>
|
||||
|
||||
<h2 id="EXAMPLES">EXAMPLES</h2>
|
||||
|
||||
<h2 id="AUTHOR">AUTHOR</h2>
|
||||
|
||||
<p>Written by Petr Korolev sky4winder@gmail.com</p>
|
||||
|
||||
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
|
||||
|
||||
<p><<a href="https://github.com/skywinder/github-changelog-generator/issues" data-bare-link="true">https://github.com/skywinder/github-changelog-generator/issues</a>></p>
|
||||
|
||||
<h2 id="SEE-ALSO">SEE ALSO</h2>
|
||||
|
||||
<p><<a href="https://github.com/skywinder/github-changelog-generator/" data-bare-link="true">https://github.com/skywinder/github-changelog-generator/</a>></p>
|
||||
|
||||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>October 2015</li>
|
||||
<li class='tr'>git-generate-changelog(1)</li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
179
man/git-generate-changelog.md
Normal file
179
man/git-generate-changelog.md
Normal file
@@ -0,0 +1,179 @@
|
||||
git-generate-changelog(1) - Generate changelog from github
|
||||
================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`git generate-changelog` [-h|--help] [-u|--user] [-p|--project]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Automatically generate change log from your tags, issues, labels and pull requests on GitHub.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
-u, --user [USER]
|
||||
|
||||
Username of the owner of target GitHub repo
|
||||
|
||||
-p, --project [PROJECT]
|
||||
|
||||
Name of project on GitHub
|
||||
|
||||
-t, --token [TOKEN]
|
||||
|
||||
To make more than 50 requests per hour your GitHub token is required. You can generate it at: https://github.com/settings/tokens/new
|
||||
|
||||
-f, --date-format [FORMAT]
|
||||
|
||||
Date format. Default is %Y-%m-%d
|
||||
|
||||
-o, --output [NAME]
|
||||
|
||||
Output file. Default is CHANGELOG.md
|
||||
|
||||
-b, --base [NAME]
|
||||
|
||||
Optional base file to append generated changes to.
|
||||
|
||||
--bugs-label [LABEL]
|
||||
|
||||
Setup custom label for bug-fixes section. Default is "**Fixed bugs:**
|
||||
|
||||
--enhancement-label [LABEL]
|
||||
|
||||
Setup custom label for enhancements section. Default is "**Implemented enhancements:**"
|
||||
|
||||
--issues-label [LABEL]
|
||||
|
||||
Setup custom label for closed-issues section. Default is "**Closed issues:**"
|
||||
|
||||
--header-label [LABEL]
|
||||
|
||||
Setup custom header label. Default is "# Change Log"
|
||||
|
||||
--pr-label [LABEL]
|
||||
|
||||
Setup custom label for pull requests section. Default is "**Merged pull requests:**"
|
||||
|
||||
--[no-]issues
|
||||
|
||||
Include closed issues in changelog. Default is true
|
||||
|
||||
--[no-]issues-wo-labels
|
||||
|
||||
Include closed issues without labels in changelog. Default is true
|
||||
|
||||
--[no-]pr-wo-labels
|
||||
|
||||
Include pull requests without labels in changelog. Default is true
|
||||
|
||||
--[no-]pull-requests
|
||||
|
||||
Include pull-requests in changelog. Default is true
|
||||
|
||||
--[no-]filter-by-milestone
|
||||
|
||||
Use milestone to detect when issue was resolved. Default is true
|
||||
|
||||
--[no-]author
|
||||
|
||||
Add author of pull-request in the end. Default is true
|
||||
|
||||
--unreleased-only
|
||||
|
||||
Generate log from unreleased closed issues only.
|
||||
|
||||
--[no-]unreleased
|
||||
|
||||
Add to log unreleased closed issues. Default is true
|
||||
|
||||
--unreleased-label [label]
|
||||
|
||||
Add to log unreleased closed issues. Default is true
|
||||
|
||||
--[no-]compare-link
|
||||
|
||||
Include compare link (Full Changelog) between older version and newer version. Default is true
|
||||
|
||||
--include-labels x,y,z
|
||||
|
||||
Only issues with the specified labels will be included in the changelog.
|
||||
|
||||
--exclude-labels x,y,z
|
||||
|
||||
Issues with the specified labels will be always excluded from changelog. Default is 'duplicate,question,invalid,wontfix'
|
||||
|
||||
--bug-labels x,y,z
|
||||
|
||||
Issues with the specified labels will be always added to "Fixed bugs" section. Default is 'bug,Bug'
|
||||
|
||||
--enhancement-labels x,y,z
|
||||
|
||||
Issues with the specified labels will be always added to "Implemented enhancements" section. Default is 'enhancement,Enhancement'
|
||||
|
||||
--between-tags x,y,z
|
||||
|
||||
Change log will be filled only between specified tags
|
||||
|
||||
--exclude-tags x,y,z
|
||||
|
||||
Change log will exclude specified tags
|
||||
|
||||
--since-tag x
|
||||
|
||||
Change log will start after specified tag
|
||||
|
||||
--due-tag x
|
||||
|
||||
Change log will end before specified tag
|
||||
|
||||
--max-issues [NUMBER]
|
||||
|
||||
Max number of issues to fetch from GitHub. Default is unlimited
|
||||
|
||||
--release-url [URL]
|
||||
|
||||
The URL to point to for release links, in printf format (with the tag as variable).
|
||||
|
||||
--github-site [URL]
|
||||
|
||||
The Enterprise Github site on which your project is hosted.
|
||||
|
||||
--github-api [URL]
|
||||
|
||||
The enterprise endpoint to use for your Github API.
|
||||
|
||||
--simple-list
|
||||
|
||||
Create simple list from issues and pull requests. Default is false.
|
||||
|
||||
--future-release [RELEASE-VERSION]
|
||||
|
||||
Put the unreleased changes in the specified release number.
|
||||
|
||||
--[no-]verbose
|
||||
|
||||
Run verbosely. Default is true
|
||||
|
||||
-v, --version
|
||||
|
||||
Print version number
|
||||
|
||||
-h, --help
|
||||
|
||||
Displays Help
|
||||
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
## AUTHOR
|
||||
|
||||
Written by Petr Korolev sky4winder@gmail.com
|
||||
|
||||
## REPORTING BUGS
|
||||
|
||||
<<https://github.com/skywinder/github-changelog-generator/issues>>
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
<<https://github.com/skywinder/github-changelog-generator/>>
|
||||
0
spec/files/github_changelog_params_empty
Normal file
0
spec/files/github_changelog_params_empty
Normal file
2
spec/files/github_changelog_params_incorrect
Normal file
2
spec/files/github_changelog_params_incorrect
Normal file
@@ -0,0 +1,2 @@
|
||||
unreleased_label: staging
|
||||
unreleased: false
|
||||
3
spec/files/github_changelog_params_override
Normal file
3
spec/files/github_changelog_params_override
Normal file
@@ -0,0 +1,3 @@
|
||||
unreleased_label=staging
|
||||
unreleased=false
|
||||
header==== Changelog ===
|
||||
@@ -31,91 +31,25 @@ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
||||
SimpleCov.start
|
||||
|
||||
require "github_changelog_generator"
|
||||
require "github_changelog_generator/task"
|
||||
|
||||
# This file was generated by the `rspec --init` command. Conventionally, all
|
||||
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
||||
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
||||
# this file to always be loaded, without a need to explicitly require it in any
|
||||
# files.
|
||||
#
|
||||
# Given that it is always loaded, you are encouraged to keep this file as
|
||||
# light-weight as possible. Requiring heavyweight dependencies from this file
|
||||
# will add to the boot time of your test suite on EVERY test run, even for an
|
||||
# individual file that may not need all of that loaded. Instead, consider making
|
||||
# a separate helper file that requires the additional dependencies and performs
|
||||
# the additional setup, and require it from the spec files that actually need
|
||||
# it.
|
||||
#
|
||||
# The `.rspec` file also contains a few flags that are not defaults but that
|
||||
# users commonly want.
|
||||
#
|
||||
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
||||
RSpec.configure do |config|
|
||||
# rspec-expectations config goes here. You can use an alternate
|
||||
# assertion/expectation library such as wrong or the stdlib/minitest
|
||||
# assertions if you prefer.
|
||||
config.expect_with :rspec do |expectations|
|
||||
# This option will default to `true` in RSpec 4. It makes the `description`
|
||||
# and `failure_message` of custom matchers include text for helper methods
|
||||
# defined using `chain`, e.g.:
|
||||
# be_bigger_than(2).and_smaller_than(4).description
|
||||
# # => "be bigger than 2 and smaller than 4"
|
||||
# ...rather than:
|
||||
# # => "be bigger than 2"
|
||||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
||||
end
|
||||
|
||||
# rspec-mocks config goes here. You can use an alternate test double
|
||||
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
||||
config.mock_with :rspec do |mocks|
|
||||
# Prevents you from mocking or stubbing a method that does not exist on
|
||||
# a real object. This is generally recommended, and will default to
|
||||
# `true` in RSpec 4.
|
||||
mocks.verify_partial_doubles = true
|
||||
end
|
||||
|
||||
# These two settings work together to allow you to limit a spec run
|
||||
# to individual examples or groups you care about by tagging them with
|
||||
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
||||
# get run.
|
||||
config.filter_run :focus
|
||||
config.run_all_when_everything_filtered = true
|
||||
|
||||
# Limits the available syntax to the non-monkey patched syntax that is
|
||||
# recommended. For more details, see:
|
||||
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
||||
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
||||
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
||||
# config.disable_monkey_patching!
|
||||
|
||||
# This setting enables warnings. It's recommended, but in some cases may
|
||||
# be too noisy due to issues in dependencies.
|
||||
config.warnings = true
|
||||
|
||||
# Many RSpec users commonly either run the entire suite or an individual
|
||||
# file, and it's useful to allow more verbose output when running an
|
||||
# individual spec file.
|
||||
if config.files_to_run.one?
|
||||
# Use the documentation formatter for detailed output,
|
||||
# unless a formatter has already been configured
|
||||
# (e.g. via a command-line flag).
|
||||
config.default_formatter = "doc"
|
||||
end
|
||||
config.default_formatter = "doc" if config.files_to_run.one?
|
||||
|
||||
# Print the 10 slowest examples and example groups at the
|
||||
# end of the spec run, to help surface which specs are running
|
||||
# particularly slow.
|
||||
# config.profile_examples = 10
|
||||
|
||||
# Run specs in random order to surface order dependencies. If you find an
|
||||
# order dependency and want to debug it, you can fix the order by providing
|
||||
# the seed, which is printed after each run.
|
||||
# --seed 1234
|
||||
config.order = :random
|
||||
|
||||
# Seed global randomization in this process using the `--seed` CLI option.
|
||||
# Setting this allows you to use `--seed` to deterministically reproduce
|
||||
# test failures related to randomization by passing the same `--seed` value
|
||||
# as the one that triggered the failure.
|
||||
Kernel.srand config.seed
|
||||
end
|
||||
|
||||
@@ -87,6 +87,18 @@ describe GitHubChangelogGenerator::Generator do
|
||||
it { is_expected.to be_a Array }
|
||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
||||
end
|
||||
|
||||
context "with regex exclude_tags" do
|
||||
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[23]/) }
|
||||
it { is_expected.to be_a Array }
|
||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1))) }
|
||||
end
|
||||
|
||||
context "with non-matching regex in exclude_tags" do
|
||||
let(:generator) { GitHubChangelogGenerator::Generator.new(exclude_tags: /[abc]/) }
|
||||
it { is_expected.to be_a Array }
|
||||
it { is_expected.to match_array(tags_mash_from_strings(%w(1 2 3))) }
|
||||
end
|
||||
end
|
||||
|
||||
describe "#filter_since_tag" do
|
||||
|
||||
41
spec/unit/parse_file_spec.rb
Normal file
41
spec/unit/parse_file_spec.rb
Normal file
@@ -0,0 +1,41 @@
|
||||
describe GitHubChangelogGenerator::ParserFile do
|
||||
describe ".github_changelog_generator" do
|
||||
context "when no has file" do
|
||||
let(:options) { {} }
|
||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||
subject { parse.parse! }
|
||||
it { is_expected.to be_nil }
|
||||
end
|
||||
|
||||
context "when file is empty" do
|
||||
let(:options) { { params_file: "spec/files/github_changelog_params_empty" } }
|
||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||
|
||||
it "does not change the options" do
|
||||
expect { parse.parse! }.to_not change { options }
|
||||
end
|
||||
end
|
||||
|
||||
context "when file is incorrect" do
|
||||
let(:options) { { params_file: "spec/files/github_changelog_params_incorrect" } }
|
||||
let(:options_before_change) { options.dup }
|
||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||
it { expect { parse.parse! }.to raise_error }
|
||||
end
|
||||
|
||||
context "when override default values" do
|
||||
let(:default_options) { GitHubChangelogGenerator::Parser.get_default_options }
|
||||
let(:options) { { params_file: "spec/files/github_changelog_params_override" }.merge(default_options) }
|
||||
let(:options_before_change) { options.dup }
|
||||
let(:parse) { GitHubChangelogGenerator::ParserFile.new(options) }
|
||||
|
||||
it "changes the options" do
|
||||
expect { parse.parse! }.to change { options }
|
||||
.from(options_before_change)
|
||||
.to(options_before_change.merge(unreleased_label: "staging",
|
||||
unreleased: false,
|
||||
header: "=== Changelog ==="))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user