danger-changelog 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +9 -0
- data/doc/intridea.md +151 -0
- data/doc/keep_a_changelog.md +192 -0
- data/lib/changelog/changelog_file.rb +27 -35
- data/lib/changelog/gem_version.rb +1 -1
- data/lib/changelog/parsers.rb +19 -0
- data/lib/changelog/parsers/base.rb +27 -0
- data/lib/changelog/parsers/intridea_format.rb +41 -0
- data/lib/changelog/parsers/keep_a_changelog.rb +81 -0
- data/lib/changelog/plugin.rb +15 -8
- data/lib/danger_plugin.rb +1 -0
- data/spec/changelog_file_spec.rb +101 -98
- data/spec/changelog_spec.rb +59 -3
- data/spec/fixtures/changelogs/keep_a_changelog.md +161 -0
- metadata +11 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 581ec6b4b9c3833ce61d201ec1337a6b232a2fa2e0282eaea52aec6b4c313381
|
4
|
+
data.tar.gz: 5b0fe3313f22e010b1213eab4aaf3c6c6ba73d22702646b4d66f1bb8051975b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 671e4065da9320cc167b2e96332127f492098c1e41230ec7b78a6adf7f21cabb9da0fb49f343a95d35a8eaab637bceb1a99d13621f5757212b1ec2cf331c1ca2
|
7
|
+
data.tar.gz: d8a16a3aa427a157266f02a26687bc2ac3c9dc51ab7914c4a301b6b60cbc23587a72794644b5666fb0dca6624ee78481fb1852ca343a51248793525a12a5a5ed
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
## Changelog
|
2
2
|
|
3
|
+
### 0.5.0 (2019/05/31)
|
4
|
+
|
5
|
+
* [#41](https://github.com/dblock/danger-changelog/pull/41): Document what's a correctly-formatted CHANGELOG - [@ivoanjo](https://github.com/ivoanjo).
|
6
|
+
* [#44](https://github.com/dblock/danger-changelog/pull/44): Add support for the [Keep a Changelog](https://keepachangelog.com) format for the change log - [@michaelherold](https://github.com/michaelherold).
|
7
|
+
|
3
8
|
### 0.4.2 (2018/12/21)
|
4
9
|
|
5
10
|
* [#37](https://github.com/dblock/danger-changelog/issues/37): Allow for parenthesis and brackets around headers - [@dblock](https://github.com/dblock).
|
data/README.md
CHANGED
@@ -6,6 +6,13 @@ It can make sure, for example, that changes are attributed properly, have a vali
|
|
6
6
|
[](https://badge.fury.io/rb/danger-changelog)
|
7
7
|
[](https://travis-ci.org/dblock/danger-changelog)
|
8
8
|
|
9
|
+
## What's a correctly formatted CHANGELOG file?
|
10
|
+
|
11
|
+
By design, `danger-changelog` is quite strict with what it allows as a valid changelog file. However, there are more than one format that it supports.
|
12
|
+
|
13
|
+
* By default, it uses the [Intridea style](doc/intridea.md)
|
14
|
+
* Optionally, you can enable the [Keep a Changelog style](doc/keep_a_changelog.md)
|
15
|
+
|
9
16
|
## Installation
|
10
17
|
|
11
18
|
Add `danger-changelog` to your Gemfile.
|
@@ -44,6 +51,8 @@ Set the CHANGELOG file name, defaults to `CHANGELOG.md`.
|
|
44
51
|
|
45
52
|
Run all checks with defaults.
|
46
53
|
|
54
|
+
You can pass a different format to this method, such as `changelog.check(:keep_a_changelog)`.
|
55
|
+
|
47
56
|
#### changelog.have_you_updated_changelog?
|
48
57
|
|
49
58
|
Checks whether you have updated CHANGELOG.md.
|
data/doc/intridea.md
ADDED
@@ -0,0 +1,151 @@
|
|
1
|
+
# Intridea Style
|
2
|
+
|
3
|
+
The Intridea style changelog was pioneered on the Hashie project. It has many elements that can you use and prevents some other elements as follows.
|
4
|
+
|
5
|
+
### Titles
|
6
|
+
|
7
|
+
✅ You can have up to four levels of titles
|
8
|
+
|
9
|
+
```markdown
|
10
|
+
# This is a title for my changelog
|
11
|
+
## lower case also works and so do numbers 123
|
12
|
+
### Colons: They are awesome
|
13
|
+
#### Probably not used all that often
|
14
|
+
```
|
15
|
+
|
16
|
+
❌ Only letters (a-z), numbers, underscores and colons are allowed in titles
|
17
|
+
|
18
|
+
```markdown
|
19
|
+
#### Emoji is not allowed 😢
|
20
|
+
#### Hyphens are not allowed thus sugar-free is not valid
|
21
|
+
#### Multiple sentences. Are not allowed
|
22
|
+
#### Commas, neither
|
23
|
+
#### No accented characters sorry Beyoncé
|
24
|
+
```
|
25
|
+
|
26
|
+
❌ Titles must start with a leading space
|
27
|
+
|
28
|
+
```markdown
|
29
|
+
#This is not valid
|
30
|
+
```
|
31
|
+
|
32
|
+
✅ You can place your titles inside a single parens
|
33
|
+
|
34
|
+
```markdown
|
35
|
+
# (This is allowed)
|
36
|
+
## [This is allowed]
|
37
|
+
### {This is also allowed}
|
38
|
+
```
|
39
|
+
|
40
|
+
❌ Parens in a title must match, and you can only have one set
|
41
|
+
|
42
|
+
```markdown
|
43
|
+
# (Not valid
|
44
|
+
## {Not valid)
|
45
|
+
### Not valid ()
|
46
|
+
#### [] Not valid
|
47
|
+
#### ((Not valid))
|
48
|
+
```
|
49
|
+
|
50
|
+
✅ You can have a [semantic-versioning](https://semver.org/) compatible version number
|
51
|
+
|
52
|
+
```markdown
|
53
|
+
# 1.0.0
|
54
|
+
## 1.0.0-alpha
|
55
|
+
### (3.2.1-beta+reallybuggy.1)
|
56
|
+
```
|
57
|
+
|
58
|
+
❌ Version numbers which do not follow [semantic-versioning](https://semver.org/) are not allowed
|
59
|
+
|
60
|
+
```markdown
|
61
|
+
# 01.0.0.notvalid
|
62
|
+
```
|
63
|
+
|
64
|
+
❌ You cannot combine version numbers with other text
|
65
|
+
|
66
|
+
```markdown
|
67
|
+
# Not valid 1.0.0
|
68
|
+
# Not valid (1.0.0)
|
69
|
+
```
|
70
|
+
|
71
|
+
✅ You can include an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)-formatted date along with a version, inside or outside parens
|
72
|
+
|
73
|
+
```markdown
|
74
|
+
# 1.0.0 2019
|
75
|
+
## 1.0.0 (2019-12-31)
|
76
|
+
### (1.0.0) (2019/12/31)
|
77
|
+
#### (1.0.0) 20191231
|
78
|
+
```
|
79
|
+
|
80
|
+
❌ No other date or time formats are allowed
|
81
|
+
|
82
|
+
```markdown
|
83
|
+
# 1.0.0 (2019-12)
|
84
|
+
# 1.0.0 (2019-W1)
|
85
|
+
# 1.0.0 (2019-04-28T09:21:58Z)
|
86
|
+
# 1.0.0 (31/12/2019)
|
87
|
+
```
|
88
|
+
|
89
|
+
❌ Dates cannot be combined with normal titles
|
90
|
+
|
91
|
+
```markdown
|
92
|
+
# Not valid (2019/12/31)
|
93
|
+
```
|
94
|
+
|
95
|
+
### Changelog entries
|
96
|
+
|
97
|
+
✅ Under each title, you can have changelog entries in the format: `* {optional link to GitHub pull request that must be followed by a colon} {a single sentence of text description} - {author github link}.`:
|
98
|
+
|
99
|
+
```markdown
|
100
|
+
* Entry without a PR link - [@ivoanjo](https://github.com/ivoanjo).
|
101
|
+
* [#1](https://github.com/dblock/danger-changelog/pull/1): Entry with a PR link - [@dblock](https://github.com/dblock).
|
102
|
+
* Yes, this is a weird entry, but it's still valid! Also Beyoncé is welcome here, as is 松本 行弘 and our nice emojis 👍 - [@ivoanjo](https://github.com/ivoanjo).
|
103
|
+
```
|
104
|
+
|
105
|
+
❌ Entry descriptions need to start with an uppercase A-Z letter
|
106
|
+
|
107
|
+
```markdown
|
108
|
+
* not valid - [@ivoanjo](https://github.com/ivoanjo).
|
109
|
+
* いいえ - [@ivoanjo](https://github.com/ivoanjo).
|
110
|
+
* ❌ - [@ivoanjo](https://github.com/ivoanjo).
|
111
|
+
* [#1](https://github.com/dblock/danger-changelog/pull/1): not valid - [@dblock](https://github.com/dblock).
|
112
|
+
```
|
113
|
+
|
114
|
+
❌ GitHub pull request links need to be followed with a colon
|
115
|
+
|
116
|
+
```markdown
|
117
|
+
* [#1](https://github.com/dblock/danger-changelog/pull/1) Not valid - [@dblock](https://github.com/dblock).
|
118
|
+
```
|
119
|
+
|
120
|
+
❌ Only links to GitHub are allowed, and only using `https`
|
121
|
+
|
122
|
+
```markdown
|
123
|
+
* No GitLab - [@ivoanjo](https://gitlab.com/ivoanjo).
|
124
|
+
* No insecure http - [@ivoanjo](http://github.com/ivoanjo).
|
125
|
+
* [#1](https://you-get-the-point.com): Entry with a PR link - [@dblock](https://github.com/dblock).
|
126
|
+
```
|
127
|
+
❌ Only a single sentence is allowed
|
128
|
+
|
129
|
+
```markdown
|
130
|
+
* Did stuff. Then more stuff - [@ivoanjo](https://github.com/ivoanjo).
|
131
|
+
```
|
132
|
+
|
133
|
+
❌ A dash needs to separate the text description from the author
|
134
|
+
|
135
|
+
```markdown
|
136
|
+
* Missing a dash here ➡️ [@ivoanjo](https://github.com/ivoanjo).
|
137
|
+
```
|
138
|
+
|
139
|
+
❌ An entry must end with a period
|
140
|
+
|
141
|
+
```markdown
|
142
|
+
* Not valid - [@ivoanjo](https://github.com/ivoanjo)
|
143
|
+
```
|
144
|
+
|
145
|
+
### Blank lines
|
146
|
+
|
147
|
+
✅ You can have them
|
148
|
+
|
149
|
+
```markdown
|
150
|
+
|
151
|
+
```
|
@@ -0,0 +1,192 @@
|
|
1
|
+
# Keep a Changelog Style
|
2
|
+
|
3
|
+
The Keep a Changelog style format checks that your changelog is formatted like the specification outlined at [KeepAChangelog.com](https://keepachangelog.com).
|
4
|
+
|
5
|
+
As an example, here is a changelog formatted in the Keep a Changelog style, as borrowed from the Keep a Changelog project:
|
6
|
+
|
7
|
+
```markdown
|
8
|
+
# Changelog
|
9
|
+
|
10
|
+
All notable changes to this project will be documented in this file.
|
11
|
+
|
12
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
13
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
14
|
+
|
15
|
+
## [Unreleased]
|
16
|
+
|
17
|
+
## [1.0.0] - 2017-06-20
|
18
|
+
|
19
|
+
### Added
|
20
|
+
|
21
|
+
- New visual identity by [@tylerfortune8](https://github.com/tylerfortune8).
|
22
|
+
- Version navigation.
|
23
|
+
- Links to latest released version in previous versions.
|
24
|
+
- "Why keep a changelog?" section.
|
25
|
+
- "Who needs a changelog?" section.
|
26
|
+
- "How do I make a changelog?" section.
|
27
|
+
- "Frequently Asked Questions" section.
|
28
|
+
- New "Guiding Principles" sub-section to "How do I make a changelog?".
|
29
|
+
- Simplified and Traditional Chinese translations from [@tianshuo](https://github.com/tianshuo).
|
30
|
+
- German translation from [@mpbzh](https://github.com/mpbzh) & [@Art4](https://github.com/Art4).
|
31
|
+
- Italian translation from [@azkidenz](https://github.com/azkidenz).
|
32
|
+
- Swedish translation from [@magol](https://github.com/magol).
|
33
|
+
- Turkish translation from [@karalamalar](https://github.com/karalamalar).
|
34
|
+
- French translation from [@zapashcanon](https://github.com/zapashcanon).
|
35
|
+
- Brazilian Portugese translation from [@Webysther](https://github.com/Webysther).
|
36
|
+
- Polish translation from [@amielucha](https://github.com/amielucha) & [@m-aciek](https://github.com/m-aciek).
|
37
|
+
- Russian translation from [@aishek](https://github.com/aishek).
|
38
|
+
- Czech translation from [@h4vry](https://github.com/h4vry).
|
39
|
+
- Slovak translation from [@jkostolansky](https://github.com/jkostolansky).
|
40
|
+
- Korean translation from [@pierceh89](https://github.com/pierceh89).
|
41
|
+
- Croatian translation from [@porx](https://github.com/porx).
|
42
|
+
- Persian translation from [@Hameds](https://github.com/Hameds).
|
43
|
+
- Ukrainian translation from [@osadchyi-s](https://github.com/osadchyi-s).
|
44
|
+
|
45
|
+
### Changed
|
46
|
+
|
47
|
+
- Start using "changelog" over "change log" since it's the common usage.
|
48
|
+
- Start versioning based on the current English version at 0.3.0 to help
|
49
|
+
translation authors keep things up-to-date.
|
50
|
+
- Rewrite "What makes unicorns cry?" section.
|
51
|
+
- Rewrite "Ignoring Deprecations" sub-section to clarify the ideal
|
52
|
+
scenario.
|
53
|
+
- Improve "Commit log diffs" sub-section to further argument against
|
54
|
+
them.
|
55
|
+
- Merge "Why can’t people just use a git log diff?" with "Commit log
|
56
|
+
diffs"
|
57
|
+
- Fix typos in Simplified Chinese and Traditional Chinese translations.
|
58
|
+
- Fix typos in Brazilian Portuguese translation.
|
59
|
+
- Fix typos in Turkish translation.
|
60
|
+
- Fix typos in Czech translation.
|
61
|
+
- Fix typos in Swedish translation.
|
62
|
+
- Improve phrasing in French translation.
|
63
|
+
- Fix phrasing and spelling in German translation.
|
64
|
+
|
65
|
+
### Removed
|
66
|
+
|
67
|
+
- Section about "changelog" vs "CHANGELOG".
|
68
|
+
|
69
|
+
## [0.3.0] - 2015-12-03
|
70
|
+
|
71
|
+
### Added
|
72
|
+
|
73
|
+
- RU translation from [@aishek](https://github.com/aishek).
|
74
|
+
- pt-BR translation from [@tallesl](https://github.com/tallesl).
|
75
|
+
- es-ES translation from [@ZeliosAriex](https://github.com/ZeliosAriex).
|
76
|
+
|
77
|
+
## [0.2.0] - 2015-10-06
|
78
|
+
|
79
|
+
### Changed
|
80
|
+
|
81
|
+
- Remove exclusionary mentions of "open source" since this project can
|
82
|
+
benefit both "open" and "closed" source projects equally.
|
83
|
+
|
84
|
+
## [0.1.0] - 2015-10-06
|
85
|
+
|
86
|
+
### Added
|
87
|
+
|
88
|
+
- Answer "Should you ever rewrite a change log?".
|
89
|
+
|
90
|
+
### Changed
|
91
|
+
|
92
|
+
- Improve argument against commit logs.
|
93
|
+
- Start following [SemVer](https://semver.org) properly.
|
94
|
+
|
95
|
+
## [0.0.8] - 2015-02-17
|
96
|
+
|
97
|
+
### Changed
|
98
|
+
|
99
|
+
- Update year to match in every README example.
|
100
|
+
- Reluctantly stop making fun of Brits only, since most of the world
|
101
|
+
writes dates in a strange way.
|
102
|
+
|
103
|
+
### Fixed
|
104
|
+
|
105
|
+
- Fix typos in recent README changes.
|
106
|
+
- Update outdated unreleased diff link.
|
107
|
+
|
108
|
+
## [0.0.7] - 2015-02-16
|
109
|
+
|
110
|
+
### Added
|
111
|
+
|
112
|
+
- Link, and make it obvious that date format is ISO 8601.
|
113
|
+
|
114
|
+
### Changed
|
115
|
+
|
116
|
+
- Clarified the section on "Is there a standard change log format?".
|
117
|
+
|
118
|
+
### Fixed
|
119
|
+
|
120
|
+
- Fix Markdown links to tag comparison URL with footnote-style links.
|
121
|
+
|
122
|
+
## [0.0.6] - 2014-12-12
|
123
|
+
|
124
|
+
### Added
|
125
|
+
|
126
|
+
- README section on "yanked" releases.
|
127
|
+
|
128
|
+
## [0.0.5] - 2014-08-09
|
129
|
+
|
130
|
+
### Added
|
131
|
+
|
132
|
+
- Markdown links to version tags on release headings.
|
133
|
+
- Unreleased section to gather unreleased changes and encourage note
|
134
|
+
keeping prior to releases.
|
135
|
+
|
136
|
+
## [0.0.4] - 2014-08-09
|
137
|
+
|
138
|
+
### Added
|
139
|
+
|
140
|
+
- Better explanation of the difference between the file ("CHANGELOG")
|
141
|
+
and its function "the change log".
|
142
|
+
|
143
|
+
### Changed
|
144
|
+
|
145
|
+
- Refer to a "change log" instead of a "CHANGELOG" throughout the site
|
146
|
+
to differentiate between the file and the purpose of the file — the
|
147
|
+
logging of changes.
|
148
|
+
|
149
|
+
### Removed
|
150
|
+
|
151
|
+
- Remove empty sections from CHANGELOG, they occupy too much space and
|
152
|
+
create too much noise in the file. People will have to assume that the
|
153
|
+
missing sections were intentionally left out because they contained no
|
154
|
+
notable changes.
|
155
|
+
|
156
|
+
## [0.0.3] - 2014-08-09
|
157
|
+
|
158
|
+
### Added
|
159
|
+
|
160
|
+
- "Why should I care?" section mentioning The Changelog podcast.
|
161
|
+
|
162
|
+
## [0.0.2] - 2014-07-10
|
163
|
+
|
164
|
+
### Added
|
165
|
+
|
166
|
+
- Explanation of the recommended reverse chronological release ordering.
|
167
|
+
|
168
|
+
## [0.0.1] - 2014-05-31
|
169
|
+
|
170
|
+
### Added
|
171
|
+
|
172
|
+
- This CHANGELOG file to hopefully serve as an evolving example of a
|
173
|
+
standardized open source project CHANGELOG.
|
174
|
+
- CNAME file to enable GitHub Pages custom domain
|
175
|
+
- README now contains answers to common questions about CHANGELOGs
|
176
|
+
- Good examples and basic guidelines, including proper date formatting.
|
177
|
+
- Counter-examples: "What makes unicorns cry?"
|
178
|
+
|
179
|
+
[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD
|
180
|
+
[1.0.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.3.0...v1.0.0
|
181
|
+
[0.3.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.2.0...v0.3.0
|
182
|
+
[0.2.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.1.0...v0.2.0
|
183
|
+
[0.1.0]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.8...v0.1.0
|
184
|
+
[0.0.8]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.7...v0.0.8
|
185
|
+
[0.0.7]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.6...v0.0.7
|
186
|
+
[0.0.6]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.5...v0.0.6
|
187
|
+
[0.0.5]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.4...v0.0.5
|
188
|
+
[0.0.4]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.3...v0.0.4
|
189
|
+
[0.0.3]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.2...v0.0.3
|
190
|
+
[0.0.2]: https://github.com/olivierlacan/keep-a-changelog/compare/v0.0.1...v0.0.2
|
191
|
+
[0.0.1]: https://github.com/olivierlacan/keep-a-changelog/releases/tag/v0.0.1
|
192
|
+
```
|
@@ -2,60 +2,52 @@ module Danger
|
|
2
2
|
module Changelog
|
3
3
|
# A CHANGELOG.md file reader.
|
4
4
|
class ChangelogFile
|
5
|
-
attr_reader :filename, :bad_lines, :exists
|
5
|
+
attr_reader :filename, :bad_lines, :exists, :global_failures
|
6
6
|
|
7
|
-
def initialize(filename = 'CHANGELOG.md')
|
7
|
+
def initialize(filename = 'CHANGELOG.md', parser: Parsers.lookup(Parsers.default_format))
|
8
8
|
@filename = filename
|
9
9
|
@exists = File.exist?(filename)
|
10
|
-
|
10
|
+
@bad_lines = []
|
11
|
+
@global_failures = []
|
12
|
+
@parser = parser
|
13
|
+
|
14
|
+
parser.add_listener(self)
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_bad_line(line)
|
18
|
+
@bad_lines << line
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_global_failure(message)
|
22
|
+
@global_failures << message
|
23
|
+
end
|
24
|
+
|
25
|
+
def parse
|
26
|
+
return unless exists?
|
27
|
+
|
28
|
+
@parser.parse(filename)
|
11
29
|
end
|
12
30
|
|
13
31
|
# Any bad_lines?
|
14
32
|
def bad_lines?
|
15
|
-
|
33
|
+
bad_lines.any?
|
16
34
|
end
|
17
35
|
|
18
|
-
def
|
19
|
-
|
36
|
+
def global_failures?
|
37
|
+
global_failures.any?
|
20
38
|
end
|
21
39
|
|
22
|
-
def
|
23
|
-
!!@
|
40
|
+
def exists?
|
41
|
+
!!@exists
|
24
42
|
end
|
25
43
|
|
26
44
|
def bad?
|
27
|
-
bad_lines? ||
|
45
|
+
bad_lines? || global_failures?
|
28
46
|
end
|
29
47
|
|
30
48
|
def good?
|
31
49
|
!bad?
|
32
50
|
end
|
33
|
-
|
34
|
-
private
|
35
|
-
|
36
|
-
# Parse CHANGELOG file.
|
37
|
-
def parse
|
38
|
-
@your_contribution_here = false
|
39
|
-
@bad_lines = []
|
40
|
-
File.open(filename).each_line do |line|
|
41
|
-
next if line.strip.empty?
|
42
|
-
|
43
|
-
changelog_line = ChangelogLineParser.parse(line)
|
44
|
-
|
45
|
-
# puts "#{line.strip}: #{changelog_line.invalid?} (#{changelog_line})"
|
46
|
-
|
47
|
-
if changelog_line.nil? || changelog_line.invalid?
|
48
|
-
@bad_lines << line
|
49
|
-
next
|
50
|
-
end
|
51
|
-
|
52
|
-
# notice your contribution here
|
53
|
-
if changelog_line.is_a?(ChangelogPlaceholderLine)
|
54
|
-
@your_contribution_here = true
|
55
|
-
next
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
51
|
end
|
60
52
|
end
|
61
53
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'changelog/parsers/base'
|
2
|
+
require 'changelog/parsers/intridea_format'
|
3
|
+
require 'changelog/parsers/keep_a_changelog'
|
4
|
+
|
5
|
+
module Danger
|
6
|
+
module Changelog
|
7
|
+
module Parsers
|
8
|
+
def self.default_format
|
9
|
+
:intridea
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.lookup(format)
|
13
|
+
{ intridea: IntrideaFormat, keep_a_changelog: KeepAChangelog }
|
14
|
+
.fetch(format, IntrideaFormat)
|
15
|
+
.new
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Danger
|
2
|
+
module Changelog
|
3
|
+
module Parsers
|
4
|
+
class Base
|
5
|
+
def initialize(listeners = [])
|
6
|
+
@listeners = listeners
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :listeners
|
10
|
+
|
11
|
+
def add_listener(changelog)
|
12
|
+
listeners << changelog
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def notify_of_bad_line(message)
|
18
|
+
listeners.each { |changelog| changelog.add_bad_line(message) }
|
19
|
+
end
|
20
|
+
|
21
|
+
def notify_of_global_failure(message)
|
22
|
+
listeners.each { |changelog| changelog.add_global_failure(message) }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Danger
|
2
|
+
module Changelog
|
3
|
+
module Parsers
|
4
|
+
class IntrideaFormat < Base
|
5
|
+
def bad_line_message(filename)
|
6
|
+
"One of the lines below found in #{filename} doesn't match the " \
|
7
|
+
'[expected format](https://github.com/dblock/danger-changelog/blob/master/README.md#whats-a-correctly-formatted-changelog-file). ' \
|
8
|
+
'Please make it look like the other lines, pay attention to version ' \
|
9
|
+
'numbers, periods, spaces and date formats.'
|
10
|
+
end
|
11
|
+
|
12
|
+
def parse(filename)
|
13
|
+
your_contribution_here = false
|
14
|
+
|
15
|
+
File.open(filename).each_line do |line|
|
16
|
+
next if line.strip.empty?
|
17
|
+
|
18
|
+
changelog_line = ChangelogLineParser.parse(line)
|
19
|
+
|
20
|
+
if changelog_line.nil? || changelog_line.invalid?
|
21
|
+
notify_of_bad_line line
|
22
|
+
next
|
23
|
+
end
|
24
|
+
|
25
|
+
# notice your contribution here
|
26
|
+
if changelog_line.is_a?(ChangelogPlaceholderLine)
|
27
|
+
your_contribution_here = true
|
28
|
+
next
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
return if your_contribution_here
|
33
|
+
return unless Danger::Changelog.config.placeholder_line?
|
34
|
+
return unless (placeholder = Danger::Changelog.config.placeholder_line.chomp)
|
35
|
+
|
36
|
+
notify_of_global_failure "Please put back the `#{placeholder}` line into #{filename}."
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
module Danger
|
2
|
+
module Changelog
|
3
|
+
module Parsers
|
4
|
+
class KeepAChangelog < Base
|
5
|
+
def bad_line_message(filename)
|
6
|
+
"One of the lines below found in #{filename} doesn't match the " \
|
7
|
+
'[expected format](https://keepachangelog.com).'
|
8
|
+
end
|
9
|
+
|
10
|
+
def parse(filename)
|
11
|
+
blocks = parse_into_blocks(File.open(filename).each_line)
|
12
|
+
|
13
|
+
if contains_header_block?(blocks.first)
|
14
|
+
blocks = blocks[1..-1]
|
15
|
+
else
|
16
|
+
notify_of_global_failure(
|
17
|
+
'The changelog is missing the version header for the Keep A ' \
|
18
|
+
'Changelog format. See <https://keepachangelog.com> to see ' \
|
19
|
+
'the format of the header'
|
20
|
+
)
|
21
|
+
end
|
22
|
+
|
23
|
+
blocks.each do |header, *body|
|
24
|
+
notify_of_bad_line(header) unless ChangelogHeaderLine.new(header).valid?
|
25
|
+
|
26
|
+
body.each do |line|
|
27
|
+
next if approved_section?(line)
|
28
|
+
next if markdown_link?(line)
|
29
|
+
next if markdown_list_item_or_continuation?(line)
|
30
|
+
|
31
|
+
notify_of_bad_line(line)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def parse_into_blocks(lines)
|
39
|
+
blocks = []
|
40
|
+
block = []
|
41
|
+
|
42
|
+
lines.each do |line|
|
43
|
+
line = line.chomp
|
44
|
+
|
45
|
+
if /##?[^#]/.match?(line)
|
46
|
+
blocks << block.dup unless block.empty?
|
47
|
+
block.clear
|
48
|
+
end
|
49
|
+
|
50
|
+
block << line unless line.empty?
|
51
|
+
end
|
52
|
+
|
53
|
+
blocks << block.dup
|
54
|
+
end
|
55
|
+
|
56
|
+
def approved_section?(line)
|
57
|
+
/^### (Added|Changed|Deprecated|Removed|Fixed|Security)/.match?(line)
|
58
|
+
end
|
59
|
+
|
60
|
+
def contains_header_block?(block)
|
61
|
+
return false unless block
|
62
|
+
return false unless block.first == '# Changelog'
|
63
|
+
|
64
|
+
regex = %r{All notable changes to this project will be documented in this file. The format is based on \[Keep a Changelog\]\(https://keepachangelog.com/en/\d\.\d\.\d/\), and this project adheres to \[Semantic Versioning\]\(https:\/\/semver.org\/spec\/v2.0.0.html\).}
|
65
|
+
|
66
|
+
block_content = block[1..-1].join(' ')
|
67
|
+
|
68
|
+
regex.match?(block_content)
|
69
|
+
end
|
70
|
+
|
71
|
+
def markdown_link?(line)
|
72
|
+
/^\[.*\]:/.match?(line)
|
73
|
+
end
|
74
|
+
|
75
|
+
def markdown_list_item_or_continuation?(line)
|
76
|
+
/^(?:[\*-]\s| )/.match?(line)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/lib/changelog/plugin.rb
CHANGED
@@ -26,10 +26,10 @@ module Danger
|
|
26
26
|
end
|
27
27
|
|
28
28
|
# Run all checks.
|
29
|
-
# @
|
30
|
-
|
31
|
-
|
32
|
-
is_changelog_format_correct?
|
29
|
+
# @param format [Symbol] the format to check against
|
30
|
+
# @return [Boolean] true when the check passes
|
31
|
+
def check(format = Danger::Changelog::Parsers.default_format)
|
32
|
+
have_you_updated_changelog? && is_changelog_format_correct?(format)
|
33
33
|
end
|
34
34
|
|
35
35
|
# Has the CHANGELOG file been modified?
|
@@ -58,17 +58,24 @@ Here's an example of a #{filename} entry:
|
|
58
58
|
|
59
59
|
# Is the CHANGELOG.md format correct?
|
60
60
|
# @return [boolean]
|
61
|
-
def is_changelog_format_correct?
|
62
|
-
|
61
|
+
def is_changelog_format_correct?(format)
|
62
|
+
parser = Danger::Changelog::Parsers.lookup(format)
|
63
|
+
changelog_file = Danger::Changelog::ChangelogFile.new(filename, parser: parser)
|
64
|
+
|
63
65
|
if changelog_file.exists?
|
66
|
+
changelog_file.parse
|
64
67
|
changelog_file.bad_lines.each do |line|
|
65
68
|
markdown <<-MARKDOWN
|
66
69
|
```markdown
|
67
70
|
#{line}```
|
68
71
|
MARKDOWN
|
69
72
|
end
|
70
|
-
messaging.fail(
|
71
|
-
|
73
|
+
messaging.fail(parser.bad_line_message(filename), sticky: false) if changelog_file.bad_lines?
|
74
|
+
|
75
|
+
changelog_file.global_failures.each do |failure|
|
76
|
+
messaging.fail(failure, sticy: false)
|
77
|
+
end
|
78
|
+
|
72
79
|
changelog_file.good?
|
73
80
|
else
|
74
81
|
messaging.fail("The #{filename} file does not exist.", sticky: false)
|
data/lib/danger_plugin.rb
CHANGED
data/spec/changelog_file_spec.rb
CHANGED
@@ -3,105 +3,108 @@ require File.expand_path('spec_helper', __dir__)
|
|
3
3
|
describe Danger::Changelog::ChangelogFile do
|
4
4
|
let(:filename) { 'CHANGELOG.md' }
|
5
5
|
subject do
|
6
|
-
Danger::Changelog::ChangelogFile.new(filename)
|
6
|
+
Danger::Changelog::ChangelogFile.new(filename).tap(&:parse)
|
7
7
|
end
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
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
|
105
108
|
end
|
106
109
|
end
|
107
110
|
end
|
data/spec/changelog_spec.rb
CHANGED
@@ -77,7 +77,7 @@ describe Danger::Changelog do
|
|
77
77
|
|
78
78
|
context 'is_changelog_format_correct?' do
|
79
79
|
subject do
|
80
|
-
changelog.is_changelog_format_correct?
|
80
|
+
changelog.is_changelog_format_correct?(Danger::Changelog::Parsers.default_format)
|
81
81
|
end
|
82
82
|
|
83
83
|
context 'without a CHANGELOG file' do
|
@@ -178,7 +178,7 @@ describe Danger::Changelog do
|
|
178
178
|
|
179
179
|
it 'complains' do
|
180
180
|
expect(subject).to be false
|
181
|
-
expect(status_report[:errors]).to eq ["One of the lines below found in #{filename} doesn't match the expected format. Please make it look like the other lines, pay attention to version numbers, periods, spaces and date formats."]
|
181
|
+
expect(status_report[:errors]).to eq ["One of the lines below found in #{filename} doesn't match the [expected format](https://github.com/dblock/danger-changelog/blob/master/README.md#whats-a-correctly-formatted-changelog-file). Please make it look like the other lines, pay attention to version numbers, periods, spaces and date formats."]
|
182
182
|
expect(status_report[:warnings]).to eq []
|
183
183
|
expect(status_report[:markdowns].map(&:message)).to eq [
|
184
184
|
"```markdown\n* Your contribution here.\n```\n"
|
@@ -191,7 +191,7 @@ describe Danger::Changelog do
|
|
191
191
|
let(:filename) { File.expand_path('fixtures/changelogs/lines.md', __dir__) }
|
192
192
|
it 'complains' do
|
193
193
|
expect(subject).to be false
|
194
|
-
expect(status_report[:errors]).to eq ["One of the lines below found in #{filename} doesn't match the expected format. Please make it look like the other lines, pay attention to version numbers, periods, spaces and date formats."]
|
194
|
+
expect(status_report[:errors]).to eq ["One of the lines below found in #{filename} doesn't match the [expected format](https://github.com/dblock/danger-changelog/blob/master/README.md#whats-a-correctly-formatted-changelog-file). Please make it look like the other lines, pay attention to version numbers, periods, spaces and date formats."]
|
195
195
|
expect(status_report[:warnings]).to eq []
|
196
196
|
expect(status_report[:markdowns].map(&:message)).to eq [
|
197
197
|
"```markdown\nMissing star - [@dblock](https://github.com/dblock).\n```\n",
|
@@ -208,4 +208,60 @@ describe Danger::Changelog do
|
|
208
208
|
end
|
209
209
|
end
|
210
210
|
end
|
211
|
+
|
212
|
+
describe 'with the Keep a Changelog format' do
|
213
|
+
let(:filename) { File.expand_path('fixtures/changelogs/keep_a_changelog.md', __dir__) }
|
214
|
+
let(:dangerfile) { testing_dangerfile }
|
215
|
+
let(:changelog) do
|
216
|
+
dangerfile.changelog.filename = filename
|
217
|
+
dangerfile.changelog
|
218
|
+
end
|
219
|
+
let(:status_report) { changelog.status_report }
|
220
|
+
|
221
|
+
describe 'in a PR' do
|
222
|
+
before do
|
223
|
+
changelog.env.request_source.pr_json = {
|
224
|
+
'number' => 123,
|
225
|
+
'title' => 'being dangerous',
|
226
|
+
'html_url' => 'https://github.com/dblock/danger-changelog/pull/123',
|
227
|
+
'user' => {
|
228
|
+
'login' => 'dblock'
|
229
|
+
}
|
230
|
+
}
|
231
|
+
end
|
232
|
+
|
233
|
+
context '#check(:keep_a_changelog)' do
|
234
|
+
subject { changelog.check(:keep_a_changelog) }
|
235
|
+
|
236
|
+
context 'without CHANGELOG changes' do
|
237
|
+
before do
|
238
|
+
allow(changelog.git).to receive(:modified_files).and_return([])
|
239
|
+
allow(changelog.git).to receive(:added_files).and_return([])
|
240
|
+
end
|
241
|
+
|
242
|
+
it 'complains when no CHANGELOG can be found' do
|
243
|
+
expect(subject).to be false
|
244
|
+
expect(status_report[:errors]).to eq []
|
245
|
+
expect(status_report[:warnings]).to eq ["Unless you're refactoring existing code or improving documentation, please update #{filename}."]
|
246
|
+
expect(status_report[:markdowns].map(&:message)).to eq ["Here's an example of a #{filename} entry:\n\n```markdown\n* [#123](https://github.com/dblock/danger-changelog/pull/123): Being dangerous - [@dblock](https://github.com/dblock).\n```\n"]
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
context 'with CHANGELOG changes' do
|
251
|
+
before do
|
252
|
+
allow(changelog.git).to receive(:modified_files).and_return([filename])
|
253
|
+
allow(changelog.git).to receive(:added_files).and_return([])
|
254
|
+
end
|
255
|
+
|
256
|
+
it 'has no complaints' do
|
257
|
+
subject
|
258
|
+
# expect(subject).to be true
|
259
|
+
expect(status_report[:errors]).to eq []
|
260
|
+
expect(status_report[:warnings]).to eq []
|
261
|
+
expect(status_report[:markdowns]).to eq []
|
262
|
+
end
|
263
|
+
end
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
211
267
|
end
|
@@ -0,0 +1,161 @@
|
|
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
|
+
- New visual identity by [@tylerfortune8](https://github.com/tylerfortune8).
|
15
|
+
- Version navigation.
|
16
|
+
- Links to latest released version in previous versions.
|
17
|
+
- "Why keep a changelog?" section.
|
18
|
+
- "Who needs a changelog?" section.
|
19
|
+
- "How do I make a changelog?" section.
|
20
|
+
- "Frequently Asked Questions" section.
|
21
|
+
- New "Guiding Principles" sub-section to "How do I make a changelog?".
|
22
|
+
- Simplified and Traditional Chinese translations from [@tianshuo](https://github.com/tianshuo).
|
23
|
+
- German translation from [@mpbzh](https://github.com/mpbzh) & [@Art4](https://github.com/Art4).
|
24
|
+
- Italian translation from [@azkidenz](https://github.com/azkidenz).
|
25
|
+
- Swedish translation from [@magol](https://github.com/magol).
|
26
|
+
- Turkish translation from [@karalamalar](https://github.com/karalamalar).
|
27
|
+
- French translation from [@zapashcanon](https://github.com/zapashcanon).
|
28
|
+
- Brazilian Portugese translation from [@Webysther](https://github.com/Webysther).
|
29
|
+
- Polish translation from [@amielucha](https://github.com/amielucha) & [@m-aciek](https://github.com/m-aciek).
|
30
|
+
- Russian translation from [@aishek](https://github.com/aishek).
|
31
|
+
- Czech translation from [@h4vry](https://github.com/h4vry).
|
32
|
+
- Slovak translation from [@jkostolansky](https://github.com/jkostolansky).
|
33
|
+
- Korean translation from [@pierceh89](https://github.com/pierceh89).
|
34
|
+
- Croatian translation from [@porx](https://github.com/porx).
|
35
|
+
- Persian translation from [@Hameds](https://github.com/Hameds).
|
36
|
+
- Ukrainian translation from [@osadchyi-s](https://github.com/osadchyi-s).
|
37
|
+
|
38
|
+
### Changed
|
39
|
+
|
40
|
+
- Start using "changelog" over "change log" since it's the common usage.
|
41
|
+
- Start versioning based on the current English version at 0.3.0 to help
|
42
|
+
translation authors keep things up-to-date.
|
43
|
+
- Rewrite "What makes unicorns cry?" section.
|
44
|
+
- Rewrite "Ignoring Deprecations" sub-section to clarify the ideal
|
45
|
+
scenario.
|
46
|
+
- Improve "Commit log diffs" sub-section to further argument against
|
47
|
+
them.
|
48
|
+
- Merge "Why can’t people just use a git log diff?" with "Commit log
|
49
|
+
diffs"
|
50
|
+
- Fix typos in Simplified Chinese and Traditional Chinese translations.
|
51
|
+
- Fix typos in Brazilian Portuguese translation.
|
52
|
+
- Fix typos in Turkish translation.
|
53
|
+
- Fix typos in Czech translation.
|
54
|
+
- Fix typos in Swedish translation.
|
55
|
+
- Improve phrasing in French translation.
|
56
|
+
- Fix phrasing and spelling in German translation.
|
57
|
+
|
58
|
+
### Removed
|
59
|
+
|
60
|
+
- Section about "changelog" vs "CHANGELOG".
|
61
|
+
|
62
|
+
## [0.3.0] - 2015-12-03
|
63
|
+
|
64
|
+
### Added
|
65
|
+
|
66
|
+
- RU translation from [@aishek](https://github.com/aishek).
|
67
|
+
- pt-BR translation from [@tallesl](https://github.com/tallesl).
|
68
|
+
- es-ES translation from [@ZeliosAriex](https://github.com/ZeliosAriex).
|
69
|
+
|
70
|
+
## [0.2.0] - 2015-10-06
|
71
|
+
|
72
|
+
### Changed
|
73
|
+
|
74
|
+
- Remove exclusionary mentions of "open source" since this project can
|
75
|
+
benefit both "open" and "closed" source projects equally.
|
76
|
+
|
77
|
+
## [0.1.0] - 2015-10-06
|
78
|
+
|
79
|
+
### Added
|
80
|
+
|
81
|
+
- Answer "Should you ever rewrite a change log?".
|
82
|
+
|
83
|
+
### Changed
|
84
|
+
|
85
|
+
- Improve argument against commit logs.
|
86
|
+
- Start following [SemVer](https://semver.org) properly.
|
87
|
+
|
88
|
+
## [0.0.8] - 2015-02-17
|
89
|
+
|
90
|
+
### Changed
|
91
|
+
|
92
|
+
- Update year to match in every README example.
|
93
|
+
- Reluctantly stop making fun of Brits only, since most of the world
|
94
|
+
writes dates in a strange way.
|
95
|
+
|
96
|
+
### Fixed
|
97
|
+
|
98
|
+
- Fix typos in recent README changes.
|
99
|
+
- Update outdated unreleased diff link.
|
100
|
+
|
101
|
+
## [0.0.7] - 2015-02-16
|
102
|
+
|
103
|
+
### Added
|
104
|
+
- Link, and make it obvious that date format is ISO 8601.
|
105
|
+
|
106
|
+
### Changed
|
107
|
+
- Clarified the section on "Is there a standard change log format?".
|
108
|
+
|
109
|
+
### Fixed
|
110
|
+
- Fix Markdown links to tag comparison URL with footnote-style links.
|
111
|
+
|
112
|
+
## [0.0.6] - 2014-12-12
|
113
|
+
|
114
|
+
### Added
|
115
|
+
- README section on "yanked" releases.
|
116
|
+
|
117
|
+
## [0.0.5] - 2014-08-09
|
118
|
+
|
119
|
+
### Added
|
120
|
+
- Markdown links to version tags on release headings.
|
121
|
+
- Unreleased section to gather unreleased changes and encourage note
|
122
|
+
keeping prior to releases.
|
123
|
+
|
124
|
+
## [0.0.4] - 2014-08-09
|
125
|
+
|
126
|
+
### Added
|
127
|
+
- Better explanation of the difference between the file ("CHANGELOG")
|
128
|
+
and its function "the change log".
|
129
|
+
|
130
|
+
### Changed
|
131
|
+
- Refer to a "change log" instead of a "CHANGELOG" throughout the site
|
132
|
+
to differentiate between the file and the purpose of the file — the
|
133
|
+
logging of changes.
|
134
|
+
|
135
|
+
### Removed
|
136
|
+
- Remove empty sections from CHANGELOG, they occupy too much space and
|
137
|
+
create too much noise in the file. People will have to assume that the
|
138
|
+
missing sections were intentionally left out because they contained no
|
139
|
+
notable changes.
|
140
|
+
|
141
|
+
## [0.0.3] - 2014-08-09
|
142
|
+
|
143
|
+
### Added
|
144
|
+
- "Why should I care?" section mentioning The Changelog podcast.
|
145
|
+
|
146
|
+
## [0.0.2] - 2014-07-10
|
147
|
+
|
148
|
+
### Added
|
149
|
+
|
150
|
+
- Explanation of the recommended reverse chronological release ordering.
|
151
|
+
|
152
|
+
## [0.0.1] - 2014-05-31
|
153
|
+
|
154
|
+
### Added
|
155
|
+
|
156
|
+
- This CHANGELOG file to hopefully serve as an evolving example of a
|
157
|
+
standardized open source project CHANGELOG.
|
158
|
+
- CNAME file to enable GitHub Pages custom domain
|
159
|
+
- README now contains answers to common questions about CHANGELOGs
|
160
|
+
- Good examples and basic guidelines, including proper date formatting.
|
161
|
+
- Counter-examples: "What makes unicorns cry?"
|
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.
|
4
|
+
version: 0.5.0
|
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: 2019-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: danger-plugin-api
|
@@ -186,6 +186,8 @@ files:
|
|
186
186
|
- RELEASING.md
|
187
187
|
- Rakefile
|
188
188
|
- danger-changelog.gemspec
|
189
|
+
- doc/intridea.md
|
190
|
+
- doc/keep_a_changelog.md
|
189
191
|
- images/have_you_updated_changelog.png
|
190
192
|
- images/is_changelog_format_correct.png
|
191
193
|
- lib/changelog/changelog_file.rb
|
@@ -196,6 +198,10 @@ files:
|
|
196
198
|
- lib/changelog/changelog_line/changelog_placeholder_line.rb
|
197
199
|
- lib/changelog/config.rb
|
198
200
|
- lib/changelog/gem_version.rb
|
201
|
+
- lib/changelog/parsers.rb
|
202
|
+
- lib/changelog/parsers/base.rb
|
203
|
+
- lib/changelog/parsers/intridea_format.rb
|
204
|
+
- lib/changelog/parsers/keep_a_changelog.rb
|
199
205
|
- lib/changelog/plugin.rb
|
200
206
|
- lib/danger_changelog.rb
|
201
207
|
- lib/danger_plugin.rb
|
@@ -209,6 +215,7 @@ files:
|
|
209
215
|
- spec/fixtures/changelogs/customized.md
|
210
216
|
- spec/fixtures/changelogs/dates.md
|
211
217
|
- spec/fixtures/changelogs/imbalanced.md
|
218
|
+
- spec/fixtures/changelogs/keep_a_changelog.md
|
212
219
|
- spec/fixtures/changelogs/lines.md
|
213
220
|
- spec/fixtures/changelogs/minimal.md
|
214
221
|
- spec/fixtures/changelogs/missing_your_contribution_here.md
|
@@ -234,8 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
241
|
- !ruby/object:Gem::Version
|
235
242
|
version: '0'
|
236
243
|
requirements: []
|
237
|
-
|
238
|
-
rubygems_version: 2.7.6
|
244
|
+
rubygems_version: 3.0.3
|
239
245
|
signing_key:
|
240
246
|
specification_version: 4
|
241
247
|
summary: A danger.systems plugin that is OCD about your CHANGELOG.
|
@@ -250,6 +256,7 @@ test_files:
|
|
250
256
|
- spec/fixtures/changelogs/customized.md
|
251
257
|
- spec/fixtures/changelogs/dates.md
|
252
258
|
- spec/fixtures/changelogs/imbalanced.md
|
259
|
+
- spec/fixtures/changelogs/keep_a_changelog.md
|
253
260
|
- spec/fixtures/changelogs/lines.md
|
254
261
|
- spec/fixtures/changelogs/minimal.md
|
255
262
|
- spec/fixtures/changelogs/missing_your_contribution_here.md
|