github_changelog_generator 1.16.1 → 1.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/github_changelog_generator/argv_parser.rb +224 -0
- data/lib/github_changelog_generator/generator/generator_fetcher.rb +4 -5
- data/lib/github_changelog_generator/generator/generator_processor.rb +2 -1
- data/lib/github_changelog_generator/octo_fetcher.rb +21 -4
- data/lib/github_changelog_generator/options.rb +1 -0
- data/lib/github_changelog_generator/parser.rb +70 -258
- data/lib/github_changelog_generator/parser_file.rb +28 -13
- data/lib/github_changelog_generator/ssl_certs/cacert.pem +851 -1680
- data/lib/github_changelog_generator/version.rb +1 -1
- data/man/git-generate-changelog.1 +31 -31
- data/man/git-generate-changelog.1.html +30 -30
- data/man/git-generate-changelog.html +19 -19
- data/man/git-generate-changelog.md +31 -31
- data/spec/files/config_example +5 -0
- data/spec/unit/parser_spec.rb +50 -0
- metadata +5 -2
@@ -11,79 +11,79 @@ Automatically generate changelog from your tags, issues, labels and pull request
|
|
11
11
|
|
12
12
|
## OPTIONS
|
13
13
|
|
14
|
-
-u, --user
|
14
|
+
-u, --user USER
|
15
15
|
|
16
16
|
Username of the owner of target GitHub repo.
|
17
17
|
|
18
|
-
-p, --project
|
18
|
+
-p, --project PROJECT
|
19
19
|
|
20
20
|
Name of project on GitHub.
|
21
21
|
|
22
|
-
-t, --token
|
22
|
+
-t, --token TOKEN
|
23
23
|
|
24
24
|
To make more than 50 requests per hour your GitHub token is required. You can generate it at: https://github.com/settings/tokens/new
|
25
25
|
|
26
|
-
-f, --date-format
|
26
|
+
-f, --date-format FORMAT
|
27
27
|
|
28
28
|
Date format. Default is %Y-%m-%d.
|
29
29
|
|
30
|
-
-o, --output
|
30
|
+
-o, --output NAME
|
31
31
|
|
32
32
|
Output file. To print to STDOUT instead, use blank as path. Default is CHANGELOG.md.
|
33
33
|
|
34
|
-
-b, --base
|
34
|
+
-b, --base NAME
|
35
35
|
|
36
|
-
Optional base file to append generated changes to.
|
36
|
+
Optional base file to append generated changes to. Default is HISTORY.md.
|
37
37
|
|
38
|
-
--summary-label
|
38
|
+
--summary-label LABEL
|
39
39
|
|
40
40
|
Set up custom label for the release summary section. Default is "".
|
41
41
|
|
42
|
-
--breaking-label
|
42
|
+
--breaking-label LABEL
|
43
43
|
|
44
44
|
Set up custom label for breaking changes section. Default is "**Breaking changes:**".
|
45
45
|
|
46
|
-
--enhancement-label
|
46
|
+
--enhancement-label LABEL
|
47
47
|
|
48
48
|
Set up custom label for enhancements section. Default is "**Implemented enhancements:**".
|
49
49
|
|
50
|
-
--bugs-label
|
50
|
+
--bugs-label LABEL
|
51
51
|
|
52
52
|
Set up custom label for bug-fixes section. Default is "**Fixed bugs:**".
|
53
53
|
|
54
|
-
--deprecated-label
|
54
|
+
--deprecated-label LABEL
|
55
55
|
|
56
56
|
Set up custom label for deprecated section. Default is "**Deprecated:**".
|
57
57
|
|
58
|
-
--removed-label
|
58
|
+
--removed-label LABEL
|
59
59
|
|
60
60
|
Set up custom label for removed section. Default is "**Removed:**".
|
61
61
|
|
62
|
-
--security-label
|
62
|
+
--security-label LABEL
|
63
63
|
|
64
64
|
Set up custom label for security section. Default is "**Security:**".
|
65
65
|
|
66
|
-
--issues-label
|
66
|
+
--issues-label LABEL
|
67
67
|
|
68
68
|
Set up custom label for closed-issues section. Default is "**Closed issues:**".
|
69
69
|
|
70
|
-
--header-label
|
70
|
+
--header-label LABEL
|
71
71
|
|
72
72
|
Set up custom header label. Default is "# Changelog".
|
73
73
|
|
74
|
-
--configure-sections
|
74
|
+
--configure-sections HASH, STRING
|
75
75
|
|
76
76
|
Define your own set of sections which overrides all default sections.
|
77
77
|
|
78
|
-
--add-sections
|
78
|
+
--add-sections HASH, STRING
|
79
79
|
|
80
80
|
Add new sections but keep the default sections.
|
81
81
|
|
82
|
-
--front-matter
|
82
|
+
--front-matter JSON
|
83
83
|
|
84
84
|
Add YAML front matter. Formatted as JSON because it's easier to add on the command line.
|
85
85
|
|
86
|
-
--pr-label
|
86
|
+
--pr-label LABEL
|
87
87
|
|
88
88
|
Set up custom label for pull requests section. Default is "**Merged pull requests:**".
|
89
89
|
|
@@ -127,7 +127,7 @@ Automatically generate changelog from your tags, issues, labels and pull request
|
|
127
127
|
|
128
128
|
Add to log unreleased closed issues. Default is true.
|
129
129
|
|
130
|
-
--unreleased-label
|
130
|
+
--unreleased-label LABEL
|
131
131
|
|
132
132
|
Set up custom label for unreleased closed issues section. Default is "**Unreleased:**".
|
133
133
|
|
@@ -179,7 +179,7 @@ Automatically generate changelog from your tags, issues, labels and pull request
|
|
179
179
|
|
180
180
|
Changelog will exclude specified tags.
|
181
181
|
|
182
|
-
--exclude-tags-regex
|
182
|
+
--exclude-tags-regex REGEX
|
183
183
|
|
184
184
|
Apply a regular expression on tag names so that they can be excluded, for example: --exclude-tags-regex ".*\+\d{1,}".
|
185
185
|
|
@@ -195,19 +195,19 @@ Automatically generate changelog from your tags, issues, labels and pull request
|
|
195
195
|
|
196
196
|
Fetch only commits after this time. eg. "2017-01-01 10:00:00"
|
197
197
|
|
198
|
-
--max-issues
|
198
|
+
--max-issues NUMBER
|
199
199
|
|
200
200
|
Maximum number of issues to fetch from GitHub. Default is unlimited.
|
201
201
|
|
202
|
-
--release-url
|
202
|
+
--release-url URL
|
203
203
|
|
204
204
|
The URL to point to for release links, in printf format (with the tag as variable).
|
205
205
|
|
206
|
-
--github-site
|
206
|
+
--github-site URL
|
207
207
|
|
208
208
|
The Enterprise GitHub site where your project is hosted.
|
209
209
|
|
210
|
-
--github-api
|
210
|
+
--github-api URL
|
211
211
|
|
212
212
|
The enterprise endpoint to use for your GitHub API.
|
213
213
|
|
@@ -215,11 +215,11 @@ Automatically generate changelog from your tags, issues, labels and pull request
|
|
215
215
|
|
216
216
|
Create a simple list from issues and pull requests. Default is false.
|
217
217
|
|
218
|
-
--future-release
|
218
|
+
--future-release RELEASE-VERSION
|
219
219
|
|
220
220
|
Put the unreleased changes in the specified release number.
|
221
221
|
|
222
|
-
--release-branch
|
222
|
+
--release-branch RELEASE-BRANCH
|
223
223
|
|
224
224
|
Limit pull requests to the release branch, such as master or release.
|
225
225
|
|
@@ -227,15 +227,15 @@ Automatically generate changelog from your tags, issues, labels and pull request
|
|
227
227
|
|
228
228
|
Use HTTP Cache to cache GitHub API requests (useful for large repos). Default is true.
|
229
229
|
|
230
|
-
--[no-]cache-file
|
230
|
+
--[no-]cache-file CACHE-FILE
|
231
231
|
|
232
232
|
Filename to use for cache. Default is github-changelog-http-cache in a temporary directory.
|
233
233
|
|
234
|
-
--cache-log
|
234
|
+
--cache-log CACHE-LOG
|
235
235
|
|
236
236
|
Filename to use for cache log. Default is github-changelog-logger.log in a temporary directory.
|
237
237
|
|
238
|
-
--ssl-ca-file
|
238
|
+
--ssl-ca-file PATH
|
239
239
|
|
240
240
|
Path to cacert.pem file. Default is a bundled lib/github_changelog_generator/ssl_certs/cacert.pem. Respects SSL_CA_PATH.
|
241
241
|
|
data/spec/unit/parser_spec.rb
CHANGED
@@ -1,4 +1,54 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
describe GitHubChangelogGenerator::Parser do
|
4
|
+
let(:argv) { [] }
|
5
|
+
|
6
|
+
before do
|
7
|
+
# Calling abort will abort the test run, allow calls to abort to not accidentaly get positive falses
|
8
|
+
allow(Kernel).to receive(:abort)
|
9
|
+
end
|
10
|
+
|
11
|
+
describe ".parse_options" do
|
12
|
+
context "when required arguments are given" do
|
13
|
+
let(:argv) { ["--user", "the user", "--project", "the_project"] }
|
14
|
+
|
15
|
+
it "executes and prints the configuration" do
|
16
|
+
expect { described_class.parse_options(argv) }.to output(/config_file=>".github_changelog_generator"/).to_stdout
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
context "when --config-file is overridden to something that is not there" do
|
21
|
+
let(:argv) { ["--config-file", "does_not_exist"] }
|
22
|
+
|
23
|
+
it "aborts the execution" do
|
24
|
+
expect(Kernel).to receive(:abort)
|
25
|
+
expect { described_class.parse_options(argv) }.to output(/Configure which user and project to work on./).to_stderr
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context "when an option with incorrect type is given" do
|
30
|
+
let(:argv) { ["--max-issues", "X"] }
|
31
|
+
|
32
|
+
it "aborts the execution with error message from parser" do
|
33
|
+
expect(Kernel).to receive(:abort)
|
34
|
+
expect { described_class.parse_options(argv) }.to output(/invalid argument: --max-issues X/).to_stderr
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
context "when path to configuration file is given" do
|
39
|
+
let(:argv) { ["--config-file", File.join(__dir__, "..", "files", "config_example")] }
|
40
|
+
|
41
|
+
it "uses the values from the configuration file" do
|
42
|
+
expect { described_class.parse_options(argv) }.to output(/spec_project/).to_stdout
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context "when configuration file and parameters are given" do
|
47
|
+
let(:argv) { ["--project", "stronger_project", "--config-file", File.join(__dir__, "..", "files", "config_example")] }
|
48
|
+
|
49
|
+
it "uses the values from the arguments" do
|
50
|
+
expect { described_class.parse_options(argv) }.to output(/stronger_project/).to_stdout
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
4
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: github_changelog_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.16.
|
4
|
+
version: 1.16.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Petr Korolev
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-04-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -154,6 +154,7 @@ files:
|
|
154
154
|
- bin/git-generate-changelog
|
155
155
|
- bin/github_changelog_generator
|
156
156
|
- lib/github_changelog_generator.rb
|
157
|
+
- lib/github_changelog_generator/argv_parser.rb
|
157
158
|
- lib/github_changelog_generator/generator/entry.rb
|
158
159
|
- lib/github_changelog_generator/generator/generator.rb
|
159
160
|
- lib/github_changelog_generator/generator/generator_fetcher.rb
|
@@ -175,6 +176,7 @@ files:
|
|
175
176
|
- man/git-generate-changelog.md
|
176
177
|
- spec/files/angular.js.md
|
177
178
|
- spec/files/bundler.md
|
179
|
+
- spec/files/config_example
|
178
180
|
- spec/files/github-changelog-generator.md
|
179
181
|
- spec/install_gem_in_bundler.gemfile
|
180
182
|
- spec/spec_helper.rb
|
@@ -237,6 +239,7 @@ summary: Script, that automatically generate changelog from your tags, issues, l
|
|
237
239
|
test_files:
|
238
240
|
- spec/files/angular.js.md
|
239
241
|
- spec/files/bundler.md
|
242
|
+
- spec/files/config_example
|
240
243
|
- spec/files/github-changelog-generator.md
|
241
244
|
- spec/install_gem_in_bundler.gemfile
|
242
245
|
- spec/spec_helper.rb
|