structured_changelog 0.11.1 → 0.11.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cac491ab13fd370431dc683aea84b1ce386d3331
4
- data.tar.gz: 3d07c2896c7888ba2878ebb58777dad97b1ef961
2
+ SHA256:
3
+ metadata.gz: 2d8ad3a77ee54fd040cb4b7af19e9c1090132520867d576c9e103d7cf8fb1894
4
+ data.tar.gz: e127913aee34cf8b9b7e20cae6df2c6407b765fd0efc02830ae05ae92ed1aed2
5
5
  SHA512:
6
- metadata.gz: 702bf465bfe2a3e7f138f8fb9bdd65aec91aa2f2edc432db5c1b10feb5b12ed1d9fd05459c7f3008abe8faec7c4cf775076c2a4e78bc59995094c51674895d57
7
- data.tar.gz: 8fd1ed2a0d6d0be5b358fc3354e4e24333c5cce67c91b0cb608b0760a04682496218bc60f03de829956078806592a3191e58fb0181feef4726de6394e3fe82c7
6
+ metadata.gz: 3259db0a48e95f16e4392769f629124f8b657b7e2a132b037195e08cb506d9000b573905edc1c738fb1bba4ae844669776a98c65db5f3362b15532113732fb38
7
+ data.tar.gz: e56b43145532327ae302dea051d02c4b35e5be4c5cbb4521451eb82ff14e18271327f0f16c9e4fb64bb9500bfed2bfe1e4614613144fb149075102bf3fe0502d
@@ -2,8 +2,12 @@
2
2
 
3
3
  * investigate partial parsing of a file if parsing slows down *too much* on large changelogs
4
4
  * validate that each line starts with BREAKING/FEATURE/FIX/ENHANCEMENT/DEPRECATION
5
- * require release block lines to be ordered in descending severity
6
5
  * disable strict semver version validation before 1.0.0
6
+ * `rake changelog:todos` to show todos that, based on the current commit history release lines, need to be fixed before the next release.
7
+
8
+ ## RELEASE 0.11.2
9
+
10
+ * ENHANCEMENT: Now if you use `BREAKING: we broke a thing` instead of `* BREAKING: we broke a thing` in a git commit message release line, the `rake changelog:preview` and `rake changelog:compile` tasks will still retrieve those commit lines
7
11
 
8
12
  ## RELEASE 0.11.1
9
13
 
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in structured_changelog.gemspec
4
4
  gemspec
5
+
6
+ gem 'coveralls', require: false
@@ -0,0 +1,291 @@
1
+ = StructuredChangelog
2
+ :ext-relative: .adoc
3
+ :source-highlighter: coderay
4
+ :sectanchors:
5
+ :linkattrs:
6
+ :icons: font
7
+ :toc: macro
8
+ :toc-title:
9
+ :toclevels: 3
10
+ ifdef::env-github[]
11
+ :tip-caption: :bulb:
12
+ :note-caption: :information_source:
13
+ :important-caption: :heavy_exclamation_mark:
14
+ :caution-caption: :fire:
15
+ :warning-caption: :warning:
16
+ endif::[]
17
+
18
+ image:https://badge.fury.io/rb/structured_changelog.svg["Gem Version", link="https://badge.fury.io/rb/structured_changelog"]
19
+ image:https://travis-ci.org/yarmiganosca/structured_changelog.svg?branch=master["Build Status", link="https://travis-ci.org/yarmiganosca/structured_changelog"]
20
+ image:https://coveralls.io/repos/github/yarmiganosca/structured_changelog/badge.svg?branch=master["Test Coverage", link="https://coveralls.io/github/yarmiganosca/structured_changelog?branch=master"]
21
+
22
+ toc::[]
23
+
24
+ You have a changelog in your gem's repo, right? Great! Then you'll never need to manually update your `VERSION` constant again!
25
+
26
+ <<Installation,Install the gem>> and add this line to your Rakefile:
27
+
28
+ [source,ruby]
29
+ ----
30
+ require 'structured_changelog/tasks'
31
+ ----
32
+
33
+ == With A Single Contributor
34
+
35
+ If you have a single-contributor project, you can simply add release lines to `CHANGELOG.md`:
36
+
37
+ ----
38
+ * FEATURE: we added a new thing
39
+ * FIX: we fixed a broken thing
40
+ ----
41
+
42
+ then when you want to cut a release, add a `"## RELEASE X.Y.Z"` section, making the above look like:
43
+
44
+ ----
45
+ ## RELEASE X.Y.Z
46
+
47
+ * FEATURE: we added a new thing
48
+ * FIX: we fixed a broken thing
49
+ ----
50
+
51
+ and run
52
+
53
+ [subs=+macros]
54
+ ----
55
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:release
56
+ ----
57
+
58
+ This will:
59
+
60
+ 1. validate your `CHANGELOG.md`
61
+ 2. set your gem's `VERSION` constant to the latest release version specified by your `CHANGELOG.md`
62
+ 3. commit that version bump
63
+ 4. package your gem and push it to the specified gem server (rubygems.org by default)
64
+
65
+ == With Multiple Contributors
66
+
67
+ If you have multiple contributors, and you follow the single-contributor workflow, you'll end up with git merge conflicts every time different contributes add lines to the changelog in different Pull Requests. Fortunately, there's a separate workflow for projects with multiple contributors.
68
+
69
+ NOTE: Even though it was expliticitly designed for projects with multiple contributors, this workflow works just as well for projects with a single author--in fact I use it for structured_changelog.
70
+
71
+ When you want to add release notes, instead of adding them directly to the changelog, add them to any git commit:
72
+
73
+ ----
74
+ Describe what I did this commit
75
+
76
+ More description goes here
77
+
78
+ * FIX: we fixed a thing that was broken
79
+ ----
80
+
81
+ Any line in a commit message that starts with any of the following will be included in the release notes for the next version:
82
+
83
+ * ``* BREAKING: `` or ```BREAKING: ```
84
+ * ```* FEATURE: ``` or ```FEATURE: ```
85
+ * ```* ENHANCEMENT: ``` or ```ENHANCEMENT: ```
86
+ * ```* FIX: ``` or ```FIX: ```
87
+ * ```* DEPRECATION: ``` or ```DEPRECATION: ```
88
+
89
+ (We accept either with or without the asterisks so that forgetting one isn't actually a problem).
90
+
91
+ Then, when you're ready to cut a release, run:
92
+
93
+ [subs=+macros]
94
+ ----
95
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:compile
96
+ ----
97
+
98
+ This will pull all the release lines you've written in git commit messages since the last release from the commit log, and create a new release section in your changelog. It will have the minimum version possible given the change types (BREAKING is a major bump, FEATURE is a minor bump, and FIX, ENHANCEMENT, and DEPRECATION are all patch bumps).
99
+
100
+ Once the rake task has written the new section to the changelog, it's often beneficial to give it a look and make sure it's free of typos and any other mistakes. Then, run
101
+
102
+ [subs=+macros]
103
+ ----
104
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:release
105
+ ----
106
+
107
+ as usual to actually release your gem.
108
+
109
+ == Viewing Release Notes
110
+
111
+ To view the release notes of the current release:
112
+
113
+ [subs=+macros]
114
+ ----
115
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:notes
116
+ ----
117
+ [subs=+macros]
118
+ ----
119
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:notes[current]
120
+ ----
121
+
122
+ To view the release notes of every release:
123
+
124
+ [subs=+macros]
125
+ ----
126
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:notes[all]
127
+ ----
128
+
129
+ for a specific release:
130
+
131
+ [subs=+macros]
132
+ ----
133
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:notes[1.0.4]
134
+ ----
135
+
136
+ for all releases inclusively after a given release:
137
+
138
+ [subs=+macros]
139
+ ----
140
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:notes[1.0.4 <]
141
+ ----
142
+
143
+ for all releases inclusively before a given release:
144
+
145
+ [subs=+macros]
146
+ ----
147
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:notes[< 2.0.4]
148
+ ----
149
+
150
+ for all releases inclusively between two releases:
151
+
152
+ [subs=+macros]
153
+ ----
154
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:notes[1.0.4 < 2.0.4]
155
+ ----
156
+
157
+ To view the last 3 releases:
158
+
159
+ [subs=+macros]
160
+ ----
161
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:recent
162
+ ----
163
+
164
+ To view the last N releases:
165
+
166
+ [subs=+macros]
167
+ ----
168
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:recent[N]
169
+ ----
170
+
171
+ == Other Rake Tasks
172
+
173
+ To determine the version of the latest release *according to the Changelog*:
174
+
175
+ [subs=+macros]
176
+ ----
177
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:version
178
+ ----
179
+
180
+ To validate your changelog:
181
+
182
+ [subs=+macros]
183
+ ----
184
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:validate
185
+ ----
186
+
187
+ To update your gem's `VERSION` constant to the latest release in your Changelog:
188
+
189
+ [subs=+macros]
190
+ ----
191
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:sync
192
+ ----
193
+
194
+ To commit your version bump--and only your version bump:
195
+
196
+ [subs=+macros]
197
+ ----
198
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:commit
199
+ ----
200
+
201
+ To do everything but release your code (so that it can go through a PR for CI, for instance):
202
+
203
+ [subs=+macros]
204
+ ----
205
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++rake changelog:prep
206
+ ----
207
+
208
+ == Installation
209
+
210
+ Add this line to your application's Gemfile:
211
+
212
+ [source,ruby]
213
+ ----
214
+ gem 'structured_changelog'
215
+ ----
216
+
217
+ And then execute
218
+
219
+ [subs=+macros]
220
+ ----
221
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++bundle install
222
+ ----
223
+
224
+ Or, install it yourself with
225
+
226
+ [subs=+macros]
227
+ ----
228
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++gem install structured_changelog
229
+ ----
230
+
231
+ == Contributing
232
+
233
+ Bug reports and pull requests are welcome on GitHub at https://github.com/yarmiganosca/structured_changelog.
234
+
235
+ [IMPORTANT]
236
+ .Code of Conduct
237
+ ====
238
+ This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the http://contributor-covenant.org[Contributor Covenant] code of conduct.
239
+ ====
240
+
241
+ === Development
242
+
243
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
244
+
245
+ To install this gem onto your local machine, run `bundle exec rake install`.
246
+
247
+ === Testing
248
+
249
+ To run all the tests, run
250
+
251
+ [subs=+macros]
252
+ ----
253
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++bundle exec rspec
254
+ ----
255
+
256
+ === Pull Requests
257
+
258
+ Pull requests should be well-scoped and include tests appropriate to the changes.
259
+
260
+ When submitting a pull request that changes user-facing behavior, add release note lines to the commit message body http://github.com/yarmiganosca/structured_changelog#with-multiple-contributors[like this]. You can preview your release lines by running
261
+
262
+ [subs=+macros]
263
+ ----
264
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++bundle exec rake changelog:preview
265
+ ----
266
+
267
+ === Releases
268
+
269
+ Releasing a new version is a 2-step process.
270
+
271
+ First, run
272
+
273
+ [subs=+macros]
274
+ ----
275
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++bundle exec rake changelog:compile
276
+ ----
277
+
278
+ This will add a new release section before the other release sections. It will contain all the release notes in the commit messages since the last release, and will be prepopulated with the minimum possible version given those changes. Proof-read it and reorder the notes if you think doing so would be necessary or clearer. Feel free to increase the version if necessary (to force a major release, for example).
279
+
280
+ Once you're satisfied, run
281
+
282
+ [subs=+macros]
283
+ ----
284
+ +++<span style="pointer-events:none;user-select:none;">$ </span>+++bundle exec rake changelog:release
285
+ ----
286
+
287
+ This will create a git tag for the version, push git commits and tags, and push the `.gem` file to https://rubygems.org[rubygems.org].
288
+
289
+ == License
290
+
291
+ The gem is available as open source under the terms of the https://opensource.org/licenses/MIT[MIT License].
@@ -21,11 +21,16 @@ class StructuredChangelog
21
21
  attr_reader :changelog, :repo
22
22
 
23
23
  def release_notes
24
- @release_notes ||= git_log_since_last_release.
25
- split("\n").
26
- map(&:strip).
27
- grep(/^\*\ (BREAKING|FEATURE|ENHANCEMENT|FIX|DEPRECATION)\:/).
28
- join("\n")
24
+ @release_notes ||= git_log_since_last_release
25
+ .split("\n")
26
+ .map(&:strip)
27
+ .grep(/#{optional_prefix_pattern}(BREAKING|FEATURE|FIX|ENHANCEMENT|DEPRECATION):\ /)
28
+ .map { |release_line| release_line.sub(optional_prefix_pattern, "* ") }
29
+ .join("\n")
30
+ end
31
+
32
+ def optional_prefix_pattern
33
+ /^(\*\ )?/
29
34
  end
30
35
 
31
36
  def git_log_since_last_release
@@ -39,15 +44,15 @@ class StructuredChangelog
39
44
  end
40
45
 
41
46
  def new_version
42
- @new_version ||= if release_notes.match?(/^*\ BREAKING:/)
47
+ @new_version ||= if release_notes.match?(/#{optional_prefix_pattern}BREAKING:\ /)
43
48
  current_version.bump_major
44
- elsif release_notes.match?(/^*\ FEATURE:/)
49
+ elsif release_notes.match?(/#{optional_prefix_pattern}FEATURE:\ /)
45
50
  current_version.bump_minor
46
- elsif release_notes.match?(/^*\ FIX:/)
51
+ elsif release_notes.match?(/#{optional_prefix_pattern}FIX:\ /)
47
52
  current_version.bump_patch
48
- elsif release_notes.match?(/^*\ ENHANCEMENT:/)
53
+ elsif release_notes.match?(/#{optional_prefix_pattern}ENHANCEMENT:\ /)
49
54
  current_version.bump_patch
50
- elsif release_notes.match?(/^*\ DEPRECATION:/)
55
+ elsif release_notes.match?(/#{optional_prefix_pattern}DEPRECATION:\ /)
51
56
  current_version.bump_patch
52
57
  end
53
58
  end
@@ -1,3 +1,3 @@
1
1
  class StructuredChangelog
2
- VERSION = "0.11.1"
2
+ VERSION = "0.11.2"
3
3
  end
@@ -20,8 +20,8 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_development_dependency "bundler", "~> 1.13"
24
- spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "bundler"
24
+ spec.add_development_dependency "rake"
25
25
  spec.add_development_dependency "rspec", "~> 3.0"
26
26
  spec.add_development_dependency "pry-byebug"
27
27
  spec.add_development_dependency "simplecov"
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: structured_changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Hoffman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-12 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.13'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.13'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +121,7 @@ files:
121
121
  - CHANGELOG.md
122
122
  - CODE_OF_CONDUCT.md
123
123
  - Gemfile
124
- - README.md
124
+ - README.adoc
125
125
  - Rakefile
126
126
  - bin/console
127
127
  - bin/setup
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.6.3
175
+ rubygems_version: 2.7.6
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: A useful changelog, for a change.
data/README.md DELETED
@@ -1,148 +0,0 @@
1
- # StructuredChangelog
2
-
3
- You have a changelog in your repo, right? Great! Then you'll never need to manually update your `VERSION` constant again!
4
-
5
- Add this to your Rakefile:
6
-
7
- ```ruby
8
- require 'structured_changelog/tasks'
9
- ```
10
-
11
- ## With A Single Contributor
12
-
13
- If you have a single-contributor project, you can simply add release lines to `CHANGELOG.md`:
14
-
15
- ```
16
- * FEATURE: we added a new thing
17
- * FIX: we fixed a broken thing
18
- ```
19
-
20
- then when you want to cut a release, add a `"## RELEASE X.Y.Z"` section, making the above look like:
21
-
22
- ```
23
- ## RELEASE X.Y.Z
24
-
25
- * FEATURE: we added a new thing
26
- * FIX: we fixed a broken thing
27
- ```
28
-
29
- and run
30
-
31
- $ rake changelog:release
32
-
33
- This will:
34
-
35
- 1. validate your `CHANGELOG.md`
36
- 2. set your gem's `VERSION` constant to the latest release version specified by your `CHANGELOG.md`
37
- 3. commit that version bump
38
- 4. package your gem and push it to the specified gem server (rubygems.org by default)
39
-
40
- ## With Multiple Contributors
41
-
42
- If you have multiple contributors, and you follow the single-contributor workflow, you'll end up with conflicts every time multiple people go to add a line to the changelog. We have a separate workflow for you.
43
-
44
- When you want to add release notes, instead of adding them directly to the changelog, add them to any git commit:
45
-
46
- ```
47
- Describe what I did this commit
48
-
49
- More description goes here
50
-
51
- * FIX: we fixed a thing that was broken
52
- ```
53
-
54
- Any line in a commit message that starts with `* BREAKING: `, `* FEATURE: `, `* FIX: `, `* ENHANCEMENT: `, or `* DEPRECATION: ` will be included in the release notes for the next version.
55
-
56
- Then, when you're ready to cut a release, run:
57
-
58
- $ rake changelog:compile
59
-
60
- This will pull all the release lines you've written in git commit messages since the last release from the commit log, and create a new release section in your changelog. It will have the minimum version possible given the change types (BREAKING is a major bump, FEATURE is a minor bump, and FIX, ENHANCEMENT, and DEPRECATION are all patch bumps). Once the rake task has written the new section to the changelog, it's often beneficial to give it a look and make sure it's free of typos and any other mistakes. Then, run
61
-
62
- $ rake changelog:release
63
-
64
- as usual to actually release your gem.
65
-
66
- ## Viewing Release Notes
67
-
68
- To view the release notes of the current release:
69
-
70
- $ rake changelog:notes
71
- $ rake changelog:notes[current]
72
-
73
- To view the release notes of every release:
74
-
75
- $ rake changelog:notes[all]
76
-
77
- for a specific release:
78
-
79
- $ rake changelog:notes[1.0.4]
80
-
81
- for all releases inclusively after a given release:
82
-
83
- $ rake changelog:notes[1.0.4 <]
84
-
85
- for all releases inclusively before a given release:
86
-
87
- $ rake changelog:notes[< 2.0.4]
88
-
89
- for all releases inclusively between two releases:
90
-
91
- $ rake changelog:notes[1.0.4 < 2.0.4]
92
-
93
- To view the last 3 releases:
94
-
95
- $ rake changelog:recent
96
-
97
- To view the last N releases:
98
-
99
- $ rake changelog:recent[N]
100
-
101
- ## Other Rake Tasks
102
-
103
- To determine the version of the latest release *according to the Changelog*:
104
-
105
- $ rake changelog:version
106
-
107
- To validate your changelog:
108
-
109
- $ rake changelog:validate
110
-
111
- To update your gem's `VERSION` constant to the latest release in your Changelog:
112
-
113
- $ rake changelog:sync
114
-
115
- To commit your version bump--and only your version bump:
116
-
117
- $ rake changelog:commit
118
-
119
- To do everything but release your code (so that it can go through a PR for CI, for instance):
120
-
121
- $ rake changelog:prep
122
-
123
- ## Installation
124
-
125
- Add this line to your application's Gemfile:
126
-
127
- ```ruby
128
- gem 'structured_changelog'
129
- ```
130
-
131
- And then execute:
132
-
133
- $ bundle
134
-
135
- Or install it yourself as:
136
-
137
- $ gem install structured_changelog
138
-
139
- ## Development
140
-
141
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
142
-
143
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
144
-
145
- ## Contributing
146
-
147
- Bug reports and pull requests are welcome on GitHub at https://github.com/yarmiganosca/structured_changelog. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
148
-