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.
@@ -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 [USER]
14
+ -u, --user USER
15
15
 
16
16
  Username of the owner of target GitHub repo.
17
17
 
18
- -p, --project [PROJECT]
18
+ -p, --project PROJECT
19
19
 
20
20
  Name of project on GitHub.
21
21
 
22
- -t, --token [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 [FORMAT]
26
+ -f, --date-format FORMAT
27
27
 
28
28
  Date format. Default is %Y-%m-%d.
29
29
 
30
- -o, --output [NAME]
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 [NAME]
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 [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 [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 [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 [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 [LABEL]
54
+ --deprecated-label LABEL
55
55
 
56
56
  Set up custom label for deprecated section. Default is "**Deprecated:**".
57
57
 
58
- --removed-label [LABEL]
58
+ --removed-label LABEL
59
59
 
60
60
  Set up custom label for removed section. Default is "**Removed:**".
61
61
 
62
- --security-label [LABEL]
62
+ --security-label LABEL
63
63
 
64
64
  Set up custom label for security section. Default is "**Security:**".
65
65
 
66
- --issues-label [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 [LABEL]
70
+ --header-label LABEL
71
71
 
72
72
  Set up custom header label. Default is "# Changelog".
73
73
 
74
- --configure-sections [HASH, STRING]
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 [HASH, STRING]
78
+ --add-sections HASH, STRING
79
79
 
80
80
  Add new sections but keep the default sections.
81
81
 
82
- --front-matter [JSON]
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 [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 [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 [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 [NUMBER]
198
+ --max-issues NUMBER
199
199
 
200
200
  Maximum number of issues to fetch from GitHub. Default is unlimited.
201
201
 
202
- --release-url [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 [URL]
206
+ --github-site URL
207
207
 
208
208
  The Enterprise GitHub site where your project is hosted.
209
209
 
210
- --github-api [URL]
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 [RELEASE-VERSION]
218
+ --future-release RELEASE-VERSION
219
219
 
220
220
  Put the unreleased changes in the specified release number.
221
221
 
222
- --release-branch [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 [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 [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 [PATH]
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
 
@@ -0,0 +1,5 @@
1
+ user=spec_user
2
+ project=spec_project
3
+ unreleased=false
4
+ future-release=5.0.0
5
+ since-tag=1.0.0
@@ -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.1
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-03-22 00:00:00.000000000 Z
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