danger-changelog 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +10 -0
- data/.rubocop_todo.yml +1 -39
- data/.travis.yml +1 -1
- data/CHANGELOG.md +6 -0
- data/Dangerfile +1 -0
- data/Gemfile +14 -0
- data/LICENSE.txt +1 -1
- data/README.md +19 -2
- data/danger-changelog.gemspec +0 -11
- data/lib/changelog/changelog_file.rb +5 -3
- data/lib/changelog/changelog_line/changelog_entry_line.rb +31 -1
- data/lib/changelog/changelog_line/changelog_line.rb +2 -0
- data/lib/changelog/changelog_line/changelog_line_parser.rb +2 -2
- data/lib/changelog/config.rb +4 -2
- data/lib/changelog/gem_version.rb +1 -1
- data/lib/changelog/parsers.rb +1 -0
- data/lib/changelog/parsers/base.rb +2 -2
- data/lib/changelog/parsers/intridea_format.rb +2 -1
- data/lib/changelog/parsers/keep_a_changelog.rb +2 -2
- data/lib/changelog/parsers/validation_result.rb +31 -0
- data/lib/changelog/plugin.rb +10 -9
- data/spec/changelog_spec.rb +88 -254
- data/spec/config_spec.rb +11 -3
- data/spec/{changelog_entry_line_spec.rb → intridea/changelog_entry_line_spec.rb} +1 -1
- data/spec/intridea/changelog_file_spec.rb +120 -0
- data/spec/{changelog_header_line_spec.rb → intridea/changelog_header_line_spec.rb} +1 -1
- data/spec/{changelog_line_parser_spec.rb → intridea/changelog_line_parser_spec.rb} +1 -1
- data/spec/{changelog_placeholder_line_spec.rb → intridea/changelog_placeholder_line_spec.rb} +5 -3
- data/spec/intridea/changelog_spec.rb +150 -0
- data/spec/{fixtures/changelogs → intridea/fixtures}/customized.md +0 -0
- data/spec/{fixtures/changelogs → intridea/fixtures}/dates.md +0 -0
- data/spec/intridea/fixtures/extra_trailing_space.md +3 -0
- data/spec/{fixtures/changelogs → intridea/fixtures}/imbalanced.md +0 -0
- data/spec/{fixtures/changelogs → intridea/fixtures}/lines.md +0 -0
- data/spec/{fixtures/changelogs → intridea/fixtures}/minimal.md +0 -0
- data/spec/{fixtures/changelogs → intridea/fixtures}/missing_your_contribution_here.md +0 -0
- data/spec/{fixtures/changelogs → intridea/fixtures}/semver.md +0 -0
- data/spec/keep_a_changelog/changelog_spec.rb +84 -0
- data/spec/{fixtures/changelogs/keep_a_changelog.md → keep_a_changelog/fixtures/complete.md} +0 -0
- data/spec/keep_a_changelog/fixtures/invalid_line.md +23 -0
- data/spec/keep_a_changelog/fixtures/lines_with_links.md +14 -0
- data/spec/keep_a_changelog/fixtures/missing_a_version_header.md +20 -0
- data/spec/plugin_spec.rb +10 -0
- metadata +43 -168
- data/spec/changelog_file_spec.rb +0 -110
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
## [1.0.0] - 2017-06-20
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
Invalid line by [@tylerfortune8](https://github.com/tylerfortune8).
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
- Start using "changelog" over "change log" since it's the common usage.
|
19
|
+
|
20
|
+
### Removed
|
21
|
+
|
22
|
+
- Section about "changelog" vs "CHANGELOG".
|
23
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
[unreleased]: https://github.com/example/example/compare/v4.1.0...master
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
* [#1](https://github.com/example/example/pull/1): Added danger-changelog - [@dblock](https://github.com/dblock).
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
## [Unreleased]
|
6
|
+
|
7
|
+
## [1.0.0] - 2017-06-20
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- New visual identity by [@tylerfortune8](https://github.com/tylerfortune8).
|
12
|
+
|
13
|
+
### Changed
|
14
|
+
|
15
|
+
- Start using "changelog" over "change log" since it's the common usage.
|
16
|
+
|
17
|
+
### Removed
|
18
|
+
|
19
|
+
- Section about "changelog" vs "CHANGELOG".
|
20
|
+
|
data/spec/plugin_spec.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger-changelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dblock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -24,146 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: guard
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '2.14'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '2.14'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: guard-rspec
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '4.7'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '4.7'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: listen
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - '='
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 3.0.7
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - '='
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 3.0.7
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: pry
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rake
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '10.0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '10.0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: rspec
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '3.4'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '3.4'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rubocop
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: 0.61.1
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 0.61.1
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: yard
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: 0.9.11
|
160
|
-
type: :development
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 0.9.11
|
167
27
|
description: A danger.systems plugin that is OCD about your CHANGELOG.
|
168
28
|
email:
|
169
29
|
- dblock@dblock.org
|
@@ -202,24 +62,32 @@ files:
|
|
202
62
|
- lib/changelog/parsers/base.rb
|
203
63
|
- lib/changelog/parsers/intridea_format.rb
|
204
64
|
- lib/changelog/parsers/keep_a_changelog.rb
|
65
|
+
- lib/changelog/parsers/validation_result.rb
|
205
66
|
- lib/changelog/plugin.rb
|
206
67
|
- lib/danger_changelog.rb
|
207
68
|
- lib/danger_plugin.rb
|
208
|
-
- spec/changelog_entry_line_spec.rb
|
209
|
-
- spec/changelog_file_spec.rb
|
210
|
-
- spec/changelog_header_line_spec.rb
|
211
|
-
- spec/changelog_line_parser_spec.rb
|
212
|
-
- spec/changelog_placeholder_line_spec.rb
|
213
69
|
- spec/changelog_spec.rb
|
214
70
|
- spec/config_spec.rb
|
215
|
-
- spec/
|
216
|
-
- spec/
|
217
|
-
- spec/
|
218
|
-
- spec/
|
219
|
-
- spec/
|
220
|
-
- spec/
|
221
|
-
- spec/fixtures/
|
222
|
-
- spec/fixtures/
|
71
|
+
- spec/intridea/changelog_entry_line_spec.rb
|
72
|
+
- spec/intridea/changelog_file_spec.rb
|
73
|
+
- spec/intridea/changelog_header_line_spec.rb
|
74
|
+
- spec/intridea/changelog_line_parser_spec.rb
|
75
|
+
- spec/intridea/changelog_placeholder_line_spec.rb
|
76
|
+
- spec/intridea/changelog_spec.rb
|
77
|
+
- spec/intridea/fixtures/customized.md
|
78
|
+
- spec/intridea/fixtures/dates.md
|
79
|
+
- spec/intridea/fixtures/extra_trailing_space.md
|
80
|
+
- spec/intridea/fixtures/imbalanced.md
|
81
|
+
- spec/intridea/fixtures/lines.md
|
82
|
+
- spec/intridea/fixtures/minimal.md
|
83
|
+
- spec/intridea/fixtures/missing_your_contribution_here.md
|
84
|
+
- spec/intridea/fixtures/semver.md
|
85
|
+
- spec/keep_a_changelog/changelog_spec.rb
|
86
|
+
- spec/keep_a_changelog/fixtures/complete.md
|
87
|
+
- spec/keep_a_changelog/fixtures/invalid_line.md
|
88
|
+
- spec/keep_a_changelog/fixtures/lines_with_links.md
|
89
|
+
- spec/keep_a_changelog/fixtures/missing_a_version_header.md
|
90
|
+
- spec/plugin_spec.rb
|
223
91
|
- spec/spec_helper.rb
|
224
92
|
- spec/support/shared/changelog.rb
|
225
93
|
homepage: https://github.com/dblock/danger-changelog
|
@@ -246,20 +114,27 @@ signing_key:
|
|
246
114
|
specification_version: 4
|
247
115
|
summary: A danger.systems plugin that is OCD about your CHANGELOG.
|
248
116
|
test_files:
|
249
|
-
- spec/changelog_entry_line_spec.rb
|
250
|
-
- spec/changelog_file_spec.rb
|
251
|
-
- spec/changelog_header_line_spec.rb
|
252
|
-
- spec/changelog_line_parser_spec.rb
|
253
|
-
- spec/changelog_placeholder_line_spec.rb
|
254
117
|
- spec/changelog_spec.rb
|
255
118
|
- spec/config_spec.rb
|
256
|
-
- spec/
|
257
|
-
- spec/
|
258
|
-
- spec/
|
259
|
-
- spec/
|
260
|
-
- spec/
|
261
|
-
- spec/
|
262
|
-
- spec/fixtures/
|
263
|
-
- spec/fixtures/
|
119
|
+
- spec/intridea/changelog_entry_line_spec.rb
|
120
|
+
- spec/intridea/changelog_file_spec.rb
|
121
|
+
- spec/intridea/changelog_header_line_spec.rb
|
122
|
+
- spec/intridea/changelog_line_parser_spec.rb
|
123
|
+
- spec/intridea/changelog_placeholder_line_spec.rb
|
124
|
+
- spec/intridea/changelog_spec.rb
|
125
|
+
- spec/intridea/fixtures/customized.md
|
126
|
+
- spec/intridea/fixtures/dates.md
|
127
|
+
- spec/intridea/fixtures/extra_trailing_space.md
|
128
|
+
- spec/intridea/fixtures/imbalanced.md
|
129
|
+
- spec/intridea/fixtures/lines.md
|
130
|
+
- spec/intridea/fixtures/minimal.md
|
131
|
+
- spec/intridea/fixtures/missing_your_contribution_here.md
|
132
|
+
- spec/intridea/fixtures/semver.md
|
133
|
+
- spec/keep_a_changelog/changelog_spec.rb
|
134
|
+
- spec/keep_a_changelog/fixtures/complete.md
|
135
|
+
- spec/keep_a_changelog/fixtures/invalid_line.md
|
136
|
+
- spec/keep_a_changelog/fixtures/lines_with_links.md
|
137
|
+
- spec/keep_a_changelog/fixtures/missing_a_version_header.md
|
138
|
+
- spec/plugin_spec.rb
|
264
139
|
- spec/spec_helper.rb
|
265
140
|
- spec/support/shared/changelog.rb
|
data/spec/changelog_file_spec.rb
DELETED
@@ -1,110 +0,0 @@
|
|
1
|
-
require File.expand_path('spec_helper', __dir__)
|
2
|
-
|
3
|
-
describe Danger::Changelog::ChangelogFile do
|
4
|
-
let(:filename) { 'CHANGELOG.md' }
|
5
|
-
subject do
|
6
|
-
Danger::Changelog::ChangelogFile.new(filename).tap(&:parse)
|
7
|
-
end
|
8
|
-
|
9
|
-
describe 'with the default format checker' do
|
10
|
-
context 'minimal example' do
|
11
|
-
let(:filename) { File.expand_path('fixtures/changelogs/minimal.md', __dir__) }
|
12
|
-
it 'exists?' do
|
13
|
-
expect(subject.exists?).to be true
|
14
|
-
end
|
15
|
-
it 'bad_lines?' do
|
16
|
-
expect(subject.bad_lines).to eq []
|
17
|
-
expect(subject.bad_lines?).to be false
|
18
|
-
end
|
19
|
-
it 'is valid' do
|
20
|
-
expect(subject.bad_lines?).to be false
|
21
|
-
end
|
22
|
-
it 'has your contribution here' do
|
23
|
-
expect(subject.global_failures?).to be false
|
24
|
-
end
|
25
|
-
end
|
26
|
-
context 'missing your contribution here' do
|
27
|
-
let(:filename) { File.expand_path('fixtures/changelogs/missing_your_contribution_here.md', __dir__) }
|
28
|
-
it 'is valid' do
|
29
|
-
expect(subject.bad_lines?).to be false
|
30
|
-
end
|
31
|
-
it 'is missing your contribution here' do
|
32
|
-
expect(subject.global_failures?).to be true
|
33
|
-
end
|
34
|
-
end
|
35
|
-
context 'does not exist' do
|
36
|
-
let(:filename) { 'whatever.md' }
|
37
|
-
it 'exists?' do
|
38
|
-
expect(subject.exists?).to be false
|
39
|
-
end
|
40
|
-
it 'bad_lines?' do
|
41
|
-
expect(subject.bad_lines).to be_empty
|
42
|
-
expect(subject.bad_lines?).to be false
|
43
|
-
end
|
44
|
-
end
|
45
|
-
context 'with bad lines' do
|
46
|
-
let(:filename) { File.expand_path('fixtures/changelogs/lines.md', __dir__) }
|
47
|
-
it 'is invalid' do
|
48
|
-
expect(subject.bad_lines?).to be true
|
49
|
-
end
|
50
|
-
it 'reports all bad lines' do
|
51
|
-
expect(subject.bad_lines).to eq [
|
52
|
-
"Missing star - [@dblock](https://github.com/dblock).\n",
|
53
|
-
"* [#1](https://github.com/dblock/danger-changelog/pull/1) - Not a colon - [@dblock](https://github.com/dblock).\n",
|
54
|
-
"* [#1](https://github.com/dblock/danger-changelog/pull/1): No final period - [@dblock](https://github.com/dblock)\n",
|
55
|
-
"# [#1](https://github.com/dblock/danger-changelog/pull/1): Hash instead of star - [@dblock](https://github.com/dblock).\n",
|
56
|
-
"* [#1](https://github.com/dblock/danger-changelog/pull/1): Extra period. - [@dblock](https://github.com/dblock).\n",
|
57
|
-
"* [#1](https://github.com/dblock/danger-changelog/pull/1): Unbalanced ( - [@dblock](https://github.com/dblock).\n",
|
58
|
-
"* [#1](https://github.com/dblock/danger-changelog/pull/1): Unbalanced ] - [@dblock](https://github.com/dblock).\n"
|
59
|
-
]
|
60
|
-
end
|
61
|
-
it 'has your contribution here' do
|
62
|
-
expect(subject.global_failures?).to be false
|
63
|
-
end
|
64
|
-
end
|
65
|
-
context 'with bad dates' do
|
66
|
-
let(:filename) { File.expand_path('fixtures/changelogs/dates.md', __dir__) }
|
67
|
-
it 'is invalid' do
|
68
|
-
expect(subject.bad_lines?).to be true
|
69
|
-
end
|
70
|
-
it 'reports all bad dates' do
|
71
|
-
expect(subject.bad_lines).to eq [
|
72
|
-
"### 1.2.3 (1/2/2018)\n",
|
73
|
-
"### 1.2.3 (2018/13/1)\n",
|
74
|
-
"### 1.2.3 (2018/13)\n",
|
75
|
-
"### 1.2.3 (2018/1/1/3)\n"
|
76
|
-
]
|
77
|
-
end
|
78
|
-
end
|
79
|
-
context 'with bad semver' do
|
80
|
-
let(:filename) { File.expand_path('fixtures/changelogs/semver.md', __dir__) }
|
81
|
-
it 'is invalid' do
|
82
|
-
expect(subject.bad_lines?).to be true
|
83
|
-
end
|
84
|
-
it 'reports all bad dates' do
|
85
|
-
expect(subject.bad_lines).to eq [
|
86
|
-
"### 0 (2018/1/1)\n",
|
87
|
-
"### 0. (2018/1/1)\n",
|
88
|
-
"### 0.1. (2018/1/1)\n"
|
89
|
-
]
|
90
|
-
end
|
91
|
-
end
|
92
|
-
context 'with imbalanced parenthesis' do
|
93
|
-
let(:filename) { File.expand_path('fixtures/changelogs/imbalanced.md', __dir__) }
|
94
|
-
it 'is invalid' do
|
95
|
-
expect(subject.bad_lines?).to be true
|
96
|
-
end
|
97
|
-
it 'reports all bad lines' do
|
98
|
-
expect(subject.bad_lines).to eq [
|
99
|
-
"### 0.0.0)\n",
|
100
|
-
"### (0.0.1\n",
|
101
|
-
"### 1.2.3 (2018/1/1\n",
|
102
|
-
"### 0.1.0 2018/1/1)\n",
|
103
|
-
"### 0 ((2018/1/1)\n",
|
104
|
-
"### 0. [2018/1/1)\n",
|
105
|
-
"### 0.1. (2018/1/1)]\n"
|
106
|
-
]
|
107
|
-
end
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|