release-notes 1.3.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +5 -0
- data/.gitignore +1 -1
- data/.rubocop.yml +3 -1
- data/.travis.yml +1 -1
- data/CHANGELOG.md +147 -0
- data/CODE_OF_CONDUCT.md +58 -31
- data/README.md +8 -6
- data/bin/publish +75 -0
- data/lib/generators/release/notes/install/templates/release_notes.rb +9 -8
- data/lib/release/notes/configuration.rb +10 -11
- data/lib/release/notes/git.rb +11 -3
- data/lib/release/notes/link.rb +0 -2
- data/lib/release/notes/log.rb +77 -35
- data/lib/release/notes/pretty_print.rb +0 -2
- data/lib/release/notes/system.rb +4 -0
- data/lib/release/notes/version.rb +1 -1
- data/lib/release/notes/write.rb +0 -2
- data/release-notes.gemspec +2 -2
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3db50bbc2d93a02a0f3734d38418ed4cfb9ccf7b51cfd0eb33e78ac9c26fa2f4
|
4
|
+
data.tar.gz: 886d3f94f4b06ba7bf4d7c9b3bd67802c4ffe48a885e84067489d56b8c804dda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f31ea87a15850deaf208c6dba14eed22e9bc844318e7ac40b4781e1f351d6a71ff6dfa56decdf759b764aeb3edfecff9ac9a932bbd197bb74927fc802f6134f1
|
7
|
+
data.tar.gz: 2c7d83dbcba108213ac4d464cdb998a3e88da136d5850969ba98e77686de3b338d9066827757f1424b4dc4fbcb4bdb41577c72445ce1d7f3245481729d4852f3
|
data/.codeclimate.yml
ADDED
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
AllCops:
|
2
|
-
TargetRubyVersion: 2.
|
2
|
+
TargetRubyVersion: 2.6.0
|
3
3
|
Exclude:
|
4
4
|
- "bin/*"
|
5
5
|
- "./**/*.gemspec"
|
@@ -13,6 +13,8 @@ Metrics/LineLength:
|
|
13
13
|
|
14
14
|
Metrics/MethodLength:
|
15
15
|
Max: 21
|
16
|
+
Exclude:
|
17
|
+
- "lib/release/notes/configuration.rb"
|
16
18
|
|
17
19
|
Metrics/BlockLength:
|
18
20
|
Max: 40
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,147 @@
|
|
1
|
+
# Release Notes
|
2
|
+
|
3
|
+
## v1.3.0
|
4
|
+
|
5
|
+
**Implemented enhancements:**
|
6
|
+
|
7
|
+
- Add Configuration#header_title
|
8
|
+
- More updates to README
|
9
|
+
- Update README to explain how grep works
|
10
|
+
- Add logo
|
11
|
+
- Remove System#invert_log ;B
|
12
|
+
|
13
|
+
**Fixed bugs:**
|
14
|
+
|
15
|
+
- Amend rubocop config & remove inline disables
|
16
|
+
|
17
|
+
**Miscellaneous:**
|
18
|
+
|
19
|
+
- Bump release-notes to 1.3.0
|
20
|
+
|
21
|
+
## v1.2.1
|
22
|
+
|
23
|
+
**Fixed bugs:**
|
24
|
+
|
25
|
+
- Fix cognitive complexity of split_words ;F
|
26
|
+
|
27
|
+
**Miscellaneous:**
|
28
|
+
|
29
|
+
- Bump release-notes to 1.2.1
|
30
|
+
|
31
|
+
## v1.2.0
|
32
|
+
|
33
|
+
**Implemented enhancements:**
|
34
|
+
|
35
|
+
- Output the line if not prettifying (#35)
|
36
|
+
|
37
|
+
**Fixed bugs:**
|
38
|
+
|
39
|
+
- Fix log_all option and invert-grep ;B
|
40
|
+
- Fix travis - actually run rspec tests ;B
|
41
|
+
|
42
|
+
**Miscellaneous:**
|
43
|
+
|
44
|
+
- Bump release-notes to 1.2.0
|
45
|
+
|
46
|
+
## v1.1.2
|
47
|
+
|
48
|
+
**Implemented enhancements:**
|
49
|
+
|
50
|
+
- Update binstub to support config file in config/ folder
|
51
|
+
|
52
|
+
**Miscellaneous:**
|
53
|
+
|
54
|
+
- Bump release-notes to 1.1.2
|
55
|
+
|
56
|
+
## v1.1.1
|
57
|
+
|
58
|
+
**Implemented enhancements:**
|
59
|
+
|
60
|
+
- Update README
|
61
|
+
- Update binstub to check non-rails config file
|
62
|
+
|
63
|
+
**Fixed bugs:**
|
64
|
+
|
65
|
+
- Fix README
|
66
|
+
|
67
|
+
**Miscellaneous:**
|
68
|
+
|
69
|
+
- Bump release-notes to 1.1.1
|
70
|
+
|
71
|
+
## v1.1.0
|
72
|
+
|
73
|
+
**Implemented enhancements:**
|
74
|
+
|
75
|
+
- Light refactoring and add binstub and non-rails install
|
76
|
+
|
77
|
+
**Miscellaneous:**
|
78
|
+
|
79
|
+
- Bump release-notes to 1.1.0
|
80
|
+
|
81
|
+
## v1.0.1
|
82
|
+
|
83
|
+
**Implemented enhancements:**
|
84
|
+
|
85
|
+
- Update README.md
|
86
|
+
- Updates to README, CONTRIBUTING and add bin/test
|
87
|
+
- Update README and install template
|
88
|
+
|
89
|
+
**Fixed bugs:**
|
90
|
+
|
91
|
+
- Remove environment from rake task
|
92
|
+
- Fix contributing.md
|
93
|
+
- Fix linking/writing of none linked lines and frozen string modification
|
94
|
+
- Fix guard clause for rubocop
|
95
|
+
|
96
|
+
**Miscellaneous:**
|
97
|
+
|
98
|
+
- Bump release-notes to 1.0.1
|
99
|
+
- Bump release-notes to 1.0.0
|
100
|
+
|
101
|
+
## v1.0.0.pre
|
102
|
+
|
103
|
+
## v1.0.0
|
104
|
+
|
105
|
+
**Implemented enhancements:**
|
106
|
+
|
107
|
+
- Update README
|
108
|
+
- Add log_all option for configuration
|
109
|
+
- Add force_rewrite option to configuration
|
110
|
+
- Fix linking not adding the issue number correctly
|
111
|
+
- Add GH templates
|
112
|
+
- Add test around puts on rake task
|
113
|
+
- Refactor link.rb and increase test coverage
|
114
|
+
- Add rubocop & fix cops
|
115
|
+
- ignore .ruby-version since it's irrelevant and add different rubies to travis
|
116
|
+
- ruby version update -> 2.5.3
|
117
|
+
- Update README
|
118
|
+
|
119
|
+
**Fixed bugs:**
|
120
|
+
|
121
|
+
- Fix cops and depreciation warnings
|
122
|
+
- Fix spelling error
|
123
|
+
- Reduce cyclomatic complexity of Write.rb
|
124
|
+
- Remove extra new line on output
|
125
|
+
- Remove extra header underline on output md file
|
126
|
+
- fix readme typo
|
127
|
+
|
128
|
+
**Miscellaneous:**
|
129
|
+
|
130
|
+
- Bump release-notes to 1.0.0.pre
|
131
|
+
- Utilize bundler caching on travis
|
132
|
+
|
133
|
+
## v0.1.0
|
134
|
+
|
135
|
+
**Implemented enhancements:**
|
136
|
+
|
137
|
+
- Update prettify class
|
138
|
+
- update readme
|
139
|
+
- Update to linking commit messages
|
140
|
+
- Minor updates to layout of gem
|
141
|
+
- more readme updates
|
142
|
+
- add docs badge to readme
|
143
|
+
- add yard config
|
144
|
+
- update readme
|
145
|
+
- WIP adding test coverage to code climate
|
146
|
+
- Add badges to README
|
147
|
+
- Add some initial tests
|
data/CODE_OF_CONDUCT.md
CHANGED
@@ -1,24 +1,41 @@
|
|
1
|
-
#
|
1
|
+
# Code of Conduct
|
2
2
|
|
3
|
-
|
4
|
-
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
-
contribute through reporting issues, posting feature requests, updating
|
6
|
-
documentation, submitting pull requests or patches, and other activities.
|
3
|
+
## Our Pledge
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
- Using welcoming and inclusive language
|
18
|
+
- Being respectful of differing viewpoints and experiences
|
19
|
+
- Gracefully accepting constructive criticism
|
20
|
+
- Focusing on what is best for the community
|
21
|
+
- Showing empathy towards other community members
|
12
22
|
|
13
23
|
Examples of unacceptable behavior by participants include:
|
14
24
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
25
|
+
- The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
- Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
- Public or private harassment
|
29
|
+
- Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
22
39
|
|
23
40
|
Project maintainers have the right and responsibility to remove, edit, or
|
24
41
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
@@ -26,24 +43,34 @@ that are not aligned to this Code of Conduct, or to ban temporarily or
|
|
26
43
|
permanently any contributor for other behaviors that they deem inappropriate,
|
27
44
|
threatening, offensive, or harmful.
|
28
45
|
|
29
|
-
|
30
|
-
fairly and consistently applying these principles to every aspect of managing
|
31
|
-
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
-
Conduct may be permanently removed from the project team.
|
46
|
+
## Scope
|
33
47
|
|
34
|
-
This
|
35
|
-
when an individual is representing the project or its community.
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
36
56
|
|
37
57
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
-
reported by contacting
|
58
|
+
reported by contacting the project maintainer at dvmonroe6@gmail.com. All
|
39
59
|
complaints will be reviewed and investigated and will result in a response that
|
40
|
-
is deemed necessary and appropriate to the circumstances.
|
41
|
-
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
-
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
43
72
|
|
44
|
-
|
45
|
-
version 1.3.0, available at
|
46
|
-
[http://contributor-covenant.org/version/1/3/0/][version]
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
47
74
|
|
48
|
-
|
49
|
-
|
75
|
+
For answers to common questions about this code of conduct, see
|
76
|
+
https://www.contributor-covenant.org/faq
|
data/README.md
CHANGED
@@ -2,10 +2,13 @@
|
|
2
2
|
|
3
3
|
# Release::Notes
|
4
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/release-notes.svg)](https://badge.fury.io/rb/release-notes)
|
6
|
+
[![Documentation](http://img.shields.io/badge/rdoc-Release::Notes-blue.svg)](https://www.rubydoc.info/gems/release-notes)
|
7
|
+
[![Inline docs](http://inch-ci.org/github/dvmonroe/release-notes.svg?branch=master)](http://inch-ci.org/github/dvmonroe/release-notes)
|
8
|
+
|
5
9
|
[![Build Status](https://travis-ci.org/dvmonroe/release-notes.svg?branch=master)](https://travis-ci.org/dvmonroe/release-notes)
|
6
10
|
[![Code Climate](https://codeclimate.com/github/dvmonroe/release-notes/badges/gpa.svg)](https://codeclimate.com/github/dvmonroe/release-notes)
|
7
11
|
[![Test Coverage](https://codeclimate.com/github/dvmonroe/release-notes/badges/coverage.svg)](https://codeclimate.com/github/dvmonroe/release-notes/coverage)
|
8
|
-
[![Inline docs](http://inch-ci.org/github/dvmonroe/release-notes.svg?branch=master)](http://inch-ci.org/github/dvmonroe/release-notes)
|
9
12
|
|
10
13
|
## Automated release notes based on your project's git log.
|
11
14
|
|
@@ -65,7 +68,6 @@ Release::Notes.configure do |config|
|
|
65
68
|
config.temp_file = './release-notes.tmp.md'
|
66
69
|
config.include_merges = false
|
67
70
|
config.ignore_case = true
|
68
|
-
config.log_format = '- %s'
|
69
71
|
config.extended_regex = true
|
70
72
|
config.header_title = "tag"
|
71
73
|
config.bug_labels = %w(Fix Update)
|
@@ -80,13 +82,14 @@ Release::Notes.configure do |config|
|
|
80
82
|
config.link_to_humanize = %w()
|
81
83
|
config.link_to_sites = %w()
|
82
84
|
config.timezone = 'America/New_York'
|
83
|
-
config.prettify_messages =
|
85
|
+
config.prettify_messages = false
|
84
86
|
config.force_rewrite = false
|
87
|
+
config.single_label = true
|
85
88
|
end
|
86
89
|
```
|
87
90
|
|
88
91
|
For more information about each individual setting checkout Release::Notes's
|
89
|
-
[config docs](
|
92
|
+
[config docs](https://www.rubydoc.info/gems/release-notes).
|
90
93
|
|
91
94
|
## Usage
|
92
95
|
|
@@ -159,7 +162,6 @@ Useful information can be found here regarding the
|
|
159
162
|
- Linking is opinionated and will link to a URI structure of `#{site-url}/#{issue_number}`. It
|
160
163
|
will ouput something like: `[HONEYBADGER #33150353](https://app.honeybadger.io/projects/9999/faults/33150353)`.
|
161
164
|
This also means that your link_to_labels have to be something like `['HB #']` (PR's to make this more flexible are welcome)
|
162
|
-
- We grep the entire commit message when generating the release notes file. If you include keywords in your commit subject and message that match multiple configured labels, that commit will be listed under all relevant label headers, which could lead to commits being listed under more than one label.
|
163
165
|
|
164
166
|
## Development
|
165
167
|
|
@@ -167,7 +169,7 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
167
169
|
|
168
170
|
## Contributing
|
169
171
|
|
170
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/dvmonroe/release-notes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributing Guide](https://github.com/dvmonroe/release-notes/CONTRIBUTING.md).
|
172
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/dvmonroe/release-notes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributing Guide](https://github.com/dvmonroe/release-notes/blob/master/CONTRIBUTING.md).
|
171
173
|
|
172
174
|
## License
|
173
175
|
|
data/bin/publish
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "pathname"
|
5
|
+
require "fileutils"
|
6
|
+
require "active_support/core_ext/string"
|
7
|
+
require_relative "../lib/release/notes/version"
|
8
|
+
|
9
|
+
# path to your application root.
|
10
|
+
APP_ROOT = Pathname.new File.expand_path("..", __dir__)
|
11
|
+
MASTER_CHECK = <<~MASTER_CHECK
|
12
|
+
if [ $(git symbolic-ref --short -q HEAD) != 'master' ];
|
13
|
+
then exit 1;
|
14
|
+
fi
|
15
|
+
MASTER_CHECK
|
16
|
+
VERSION_TYPES = %w(major minor patch).freeze
|
17
|
+
|
18
|
+
def system!(*args)
|
19
|
+
system(*args) || abort("\n== Command #{args} failed ==")
|
20
|
+
end
|
21
|
+
|
22
|
+
abort("\n== Version Type incorrect ==") unless VERSION_TYPES.include?(ARGV[0])
|
23
|
+
|
24
|
+
abort("\n== Not on master") unless system(MASTER_CHECK)
|
25
|
+
|
26
|
+
current_version = Release::Notes::VERSION.split(".").map(&:to_i)
|
27
|
+
|
28
|
+
case ARGV[0]
|
29
|
+
when "major"
|
30
|
+
current_version[0] += 1
|
31
|
+
current_version[1] = 0
|
32
|
+
current_version[2] = 0
|
33
|
+
when "minor"
|
34
|
+
current_version[1] += 1
|
35
|
+
current_version[2] = 0
|
36
|
+
when "patch"
|
37
|
+
current_version[2] += 1
|
38
|
+
end
|
39
|
+
|
40
|
+
FileUtils.chdir APP_ROOT do
|
41
|
+
contents = <<~FILE
|
42
|
+
# frozen_string_literal: true
|
43
|
+
|
44
|
+
module Release
|
45
|
+
module Notes
|
46
|
+
VERSION = "#{current_version.join('.')}"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
FILE
|
50
|
+
|
51
|
+
|
52
|
+
puts "== Updating version to #{current_version.join('.')} =="
|
53
|
+
File.write("lib/release/notes/version.rb", contents)
|
54
|
+
|
55
|
+
puts "== Adding Changed Files =="
|
56
|
+
system! "git add ."
|
57
|
+
|
58
|
+
puts "== Committing updated files =="
|
59
|
+
system! "git commit -m 'Version bump to #{current_version.join('.')}'"
|
60
|
+
|
61
|
+
puts "== Tagging release =="
|
62
|
+
system! "bundle exec rake release"
|
63
|
+
|
64
|
+
puts "== Release Notes =="
|
65
|
+
system! "exe/release-notes"
|
66
|
+
|
67
|
+
puts "== Adding updated CHANGELOG =="
|
68
|
+
system! "git add CHANGELOG.md"
|
69
|
+
|
70
|
+
puts "== Committing updated files =="
|
71
|
+
system! "git commit -m 'Modify CHANGELOG.md'"
|
72
|
+
|
73
|
+
puts "== Pushing updated files =="
|
74
|
+
system! "git push origin master"
|
75
|
+
end
|
@@ -24,12 +24,6 @@ Release::Notes.configure do |config|
|
|
24
24
|
# @return [Boolean]
|
25
25
|
# config.ignore_case = true
|
26
26
|
|
27
|
-
# Allows you to specify what information you want to print from your git log
|
28
|
-
# Defaults to `%s` for subject. For more, see
|
29
|
-
# [Git Log Docs](https://git-scm.com/docs/git-log)
|
30
|
-
# @return [String]
|
31
|
-
# config.log_format = "- %s"
|
32
|
-
|
33
27
|
# Consider the limiting patterns to be extended regular expressions patterns
|
34
28
|
# when printing your git log.
|
35
29
|
# Defaults to `true`. For more, see
|
@@ -115,12 +109,19 @@ Release::Notes.configure do |config|
|
|
115
109
|
|
116
110
|
# Controls whether your commit subject labels should be removed from the final
|
117
111
|
# ouput of your message on the generated log.
|
118
|
-
# Defaults to `
|
112
|
+
# Defaults to `false`.
|
119
113
|
# @return [Boolean]
|
120
|
-
# config.prettify_messages =
|
114
|
+
# config.prettify_messages = false
|
121
115
|
|
122
116
|
# Controls whether to rewrite the output file or append to it.
|
123
117
|
# Defaults to `false`.
|
124
118
|
# @return [Boolean]
|
125
119
|
# config.force_rewrite = false
|
120
|
+
|
121
|
+
# If a commit message contains words that match more than
|
122
|
+
# one group of labels as defined in your configuration, the output
|
123
|
+
# will only contain the commit once.
|
124
|
+
# Defaults to `true`.
|
125
|
+
# @return [Boolean]
|
126
|
+
# attr_accessor :single_label
|
126
127
|
end
|
@@ -33,12 +33,6 @@ module Release
|
|
33
33
|
# @return [Boolean]
|
34
34
|
attr_accessor :extended_regex
|
35
35
|
|
36
|
-
# Allows you to specify what information you want to print from your git log
|
37
|
-
# Defaults to `%s` for subject. For more, see
|
38
|
-
# [Git Log Docs](https://git-scm.com/docs/git-log)
|
39
|
-
# @return [String]
|
40
|
-
attr_accessor :log_format
|
41
|
-
|
42
36
|
# Controls the headers that will be used for your tags
|
43
37
|
# Defaults to `tag`.
|
44
38
|
# @return [String]
|
@@ -116,7 +110,7 @@ module Release
|
|
116
110
|
|
117
111
|
# Controls whether your commit subject labels should be removed from the final
|
118
112
|
# ouput of your message on the generated log.
|
119
|
-
# Defaults to `
|
113
|
+
# Defaults to `false`.
|
120
114
|
# @return [Boolean]
|
121
115
|
attr_accessor :prettify_messages
|
122
116
|
|
@@ -125,13 +119,19 @@ module Release
|
|
125
119
|
# @return [Boolean]
|
126
120
|
attr_accessor :force_rewrite
|
127
121
|
|
122
|
+
# If a commit message contains words that match more than
|
123
|
+
# one group of labels as defined in your configuration, the output
|
124
|
+
# will only contain the commit once.
|
125
|
+
# Defaults to `true`.
|
126
|
+
# @return [Boolean]
|
127
|
+
attr_accessor :single_label
|
128
|
+
|
128
129
|
def initialize
|
129
130
|
@output_file = "./RELEASE_NOTES.md"
|
130
131
|
@temp_file = "./release-notes.tmp.md"
|
131
132
|
@include_merges = false
|
132
133
|
@ignore_case = true
|
133
134
|
@extended_regex = true
|
134
|
-
@log_format = "- %s"
|
135
135
|
@header_title = "tag"
|
136
136
|
@bug_labels = %w(Fix Update)
|
137
137
|
@feature_labels = %w(Add Create)
|
@@ -145,8 +145,9 @@ module Release
|
|
145
145
|
@link_to_humanize = %w()
|
146
146
|
@link_to_sites = %w()
|
147
147
|
@timezone = "America/New_York"
|
148
|
-
@prettify_messages =
|
148
|
+
@prettify_messages = false
|
149
149
|
@force_rewrite = false
|
150
|
+
@single_label = true
|
150
151
|
end
|
151
152
|
|
152
153
|
# @return [String]
|
@@ -205,7 +206,6 @@ module Release
|
|
205
206
|
@prettify_messages
|
206
207
|
end
|
207
208
|
|
208
|
-
# :nocov:
|
209
209
|
private
|
210
210
|
|
211
211
|
# @api private
|
@@ -236,6 +236,5 @@ module Release
|
|
236
236
|
def self.configure
|
237
237
|
yield configuration
|
238
238
|
end
|
239
|
-
# :nocov:
|
240
239
|
end
|
241
240
|
end
|
data/lib/release/notes/git.rb
CHANGED
@@ -8,17 +8,25 @@ module Release
|
|
8
8
|
extend ActiveSupport::Concern
|
9
9
|
|
10
10
|
included do
|
11
|
-
delegate :all_labels, :
|
11
|
+
delegate :all_labels, :grep_insensitive?,
|
12
12
|
:regex_type, :include_merges?, to: :"Release::Notes.configuration"
|
13
13
|
|
14
14
|
def log(**opts)
|
15
15
|
"git log '#{opts[:tag_from]}'..'#{opts[:tag_to]}'" \
|
16
16
|
" --grep='#{opts[:label]}#{opts[:invert_grep]}'" \
|
17
17
|
" #{regex_type} #{grep_insensitive?}" \
|
18
|
-
" #{include_merges?} --format='#{log_format}'"
|
18
|
+
" #{include_merges?} --format='%h #{log_format}'"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
def log_format
|
23
|
+
"- %s"
|
24
|
+
end
|
25
|
+
|
26
|
+
def first_commit
|
27
|
+
"git rev-list --max-parents=0 HEAD"
|
28
|
+
end
|
29
|
+
|
22
30
|
def last_tag
|
23
31
|
"git describe --abbrev=0 --tags"
|
24
32
|
end
|
@@ -28,7 +36,7 @@ module Release
|
|
28
36
|
end
|
29
37
|
|
30
38
|
def read_all_tags
|
31
|
-
"git
|
39
|
+
"git tag | sort -u -r"
|
32
40
|
end
|
33
41
|
end
|
34
42
|
end
|
data/lib/release/notes/link.rb
CHANGED
data/lib/release/notes/log.rb
CHANGED
@@ -4,21 +4,16 @@ module Release
|
|
4
4
|
module Notes
|
5
5
|
class Log
|
6
6
|
include System
|
7
|
-
|
8
|
-
attr_reader :writer, :date_formatter
|
9
|
-
attr_reader :all_tags
|
10
|
-
|
11
7
|
delegate :force_rewrite, :all_labels, :log_all, :header_title,
|
12
8
|
:header_title_type, :features, :bugs, :misc, :feature_title,
|
13
|
-
:bug_title, :misc_title, :log_all_title,
|
9
|
+
:bug_title, :misc_title, :log_all_title, :single_label,
|
14
10
|
:release_notes_exist?, to: :"Release::Notes.configuration"
|
15
11
|
|
16
12
|
delegate :date_humanized, :format_tag_date, to: :date_formatter
|
17
13
|
delegate :digest_header, :digest_title, to: :writer
|
18
14
|
|
19
15
|
def initialize
|
20
|
-
@
|
21
|
-
@date_formatter = Release::Notes::DateFormat.new
|
16
|
+
@_commits = []
|
22
17
|
end
|
23
18
|
|
24
19
|
def perform
|
@@ -34,41 +29,34 @@ module Release
|
|
34
29
|
writer.write_new_file
|
35
30
|
end
|
36
31
|
|
37
|
-
# :nocov:
|
38
32
|
private
|
39
33
|
|
40
|
-
def git_all_tags
|
41
|
-
@git_all_tags ||= System.all_tags.split("\n")
|
42
|
-
# return Error.new(msg: :missing_tags) unless all_tags.present?
|
43
|
-
end
|
44
|
-
|
45
34
|
# @api private
|
46
35
|
def copy_single_tag_of_activity(tag_from:, tag_to: "HEAD")
|
47
36
|
[features, bugs, misc].each_with_index do |regex, i|
|
48
|
-
log = system_log(
|
49
|
-
|
50
|
-
tag_to: tag_to,
|
51
|
-
label: regex,
|
52
|
-
log_all: false,
|
53
|
-
)
|
54
|
-
digest_title(title: titles[i], log_message: log) if log.present?
|
37
|
+
log = system_log(tag_from: tag_from, tag_to: tag_to, label: regex, log_all: log_all)
|
38
|
+
log_grouped_commits(title: titles[i], log: log)
|
55
39
|
end
|
56
40
|
|
57
41
|
return unless log_all
|
58
42
|
|
59
|
-
log = system_log(
|
60
|
-
|
61
|
-
tag_to: tag_to,
|
62
|
-
log_all: true,
|
63
|
-
)
|
64
|
-
digest_title(title: log_all_title, log_message: log) if log.present?
|
43
|
+
log = system_log(tag_from: tag_from, tag_to: tag_to)
|
44
|
+
log_grouped_commits(title: log_all_title, log: log)
|
65
45
|
end
|
66
46
|
|
67
47
|
# @api private
|
68
|
-
def
|
69
|
-
|
70
|
-
|
48
|
+
def date_formatter
|
49
|
+
@date_formatter ||= Release::Notes::DateFormat.new
|
50
|
+
end
|
71
51
|
|
52
|
+
# @api private
|
53
|
+
def find_last_tag_and_log
|
54
|
+
last_tag = system_last_tag.strip
|
55
|
+
# return false unless system_log(tag_from: last_tag, label: all_labels).present?
|
56
|
+
if system_log(tag_from: last_tag, label: all_labels).blank?
|
57
|
+
log_last
|
58
|
+
return
|
59
|
+
end
|
72
60
|
# output the date right now
|
73
61
|
header_content date: date_humanized, tag: tag_to
|
74
62
|
copy_single_tag_of_activity(tag_from: last_tag)
|
@@ -77,25 +65,79 @@ module Release
|
|
77
65
|
# @api private
|
78
66
|
def find_all_tags_and_log_all
|
79
67
|
git_all_tags.each_with_index do |ta, i|
|
80
|
-
|
81
|
-
|
82
|
-
|
68
|
+
header_content(
|
69
|
+
date: date_humanized(date: System.tag_date(tag: ta)),
|
70
|
+
tag: ta,
|
71
|
+
)
|
83
72
|
|
84
|
-
|
85
|
-
|
73
|
+
copy_single_tag_of_activity(
|
74
|
+
tag_from: previous_tag(i).strip,
|
75
|
+
tag_to: ta,
|
76
|
+
)
|
86
77
|
end
|
87
78
|
end
|
88
79
|
|
80
|
+
# @api private
|
81
|
+
def log_last
|
82
|
+
header_content date: date_humanized, tag: git_all_tags[0]
|
83
|
+
copy_single_tag_of_activity(tag_from: git_all_tags[1], tag_to: git_all_tags[0])
|
84
|
+
end
|
85
|
+
|
86
|
+
# @api private
|
87
|
+
def git_all_tags
|
88
|
+
@git_all_tags ||= System.all_tags.split("\n")
|
89
|
+
end
|
90
|
+
|
89
91
|
# @api private
|
90
92
|
def header_content(**date_and_tag)
|
91
93
|
digest_header(date_and_tag[header_title_type.to_sym])
|
92
94
|
end
|
93
95
|
|
96
|
+
# @api private
|
97
|
+
def log_grouped_commits(log:, title:)
|
98
|
+
return unless log.present?
|
99
|
+
|
100
|
+
log_messages = log.split("\n").map { |x| x.split(/(?=-)/) }
|
101
|
+
commit_hashes = log_messages.flat_map { |msg| msg[0].strip }
|
102
|
+
|
103
|
+
trimmed_commit_hashes = trim_commit_hashes(commit_hashes)
|
104
|
+
|
105
|
+
digest_unique_messages(log_messages, trimmed_commit_hashes, title) if trimmed_commit_hashes.present?
|
106
|
+
end
|
107
|
+
|
108
|
+
# @api private
|
109
|
+
def digest_unique_messages(log_messages, commit_hashes, title)
|
110
|
+
messages = log_messages.map do |msg|
|
111
|
+
msg[1..-1].join if commit_hashes.include?(msg[0].strip)
|
112
|
+
end.compact
|
113
|
+
|
114
|
+
@_commits += commit_hashes
|
115
|
+
|
116
|
+
digest_title(title: title, log_message: "#{messages.join("\n")}\n")
|
117
|
+
end
|
118
|
+
|
119
|
+
# @api private
|
120
|
+
def trim_commit_hashes(commit_hashes)
|
121
|
+
commit_hashes.dup.each do |commit|
|
122
|
+
commit_hashes.delete commit if single_label && @_commits.include?(commit)
|
123
|
+
end
|
124
|
+
commit_hashes
|
125
|
+
end
|
126
|
+
|
127
|
+
# @api private
|
128
|
+
def previous_tag(index)
|
129
|
+
git_all_tags[index + 1].present? ? git_all_tags[index + 1] : System.first_commit
|
130
|
+
end
|
131
|
+
|
94
132
|
# @api private
|
95
133
|
def titles
|
96
134
|
[feature_title, bug_title, misc_title]
|
97
135
|
end
|
98
|
-
|
136
|
+
|
137
|
+
# @api private
|
138
|
+
def writer
|
139
|
+
@writer ||= Release::Notes::Write.new
|
140
|
+
end
|
99
141
|
end
|
100
142
|
end
|
101
143
|
end
|
data/lib/release/notes/system.rb
CHANGED
data/lib/release/notes/write.rb
CHANGED
data/release-notes.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "http://github.com/dvmonroe/release-notes"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|config)/}) }
|
17
17
|
spec.bindir = "exe"
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
@@ -23,5 +23,5 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.12"
|
24
24
|
spec.add_development_dependency "pry", "~> 0.12.2"
|
25
25
|
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
-
spec.add_development_dependency "rubocop", "~> 0.
|
26
|
+
spec.add_development_dependency "rubocop", "~> 0.61.0"
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: release-notes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drew Monroe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.61.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.61.0
|
83
83
|
description: Generate automated release notes for any project
|
84
84
|
email:
|
85
85
|
- dvmonroe6@gmail.com
|
@@ -88,6 +88,7 @@ executables:
|
|
88
88
|
extensions: []
|
89
89
|
extra_rdoc_files: []
|
90
90
|
files:
|
91
|
+
- ".codeclimate.yml"
|
91
92
|
- ".github/ISSUE_TEMPLATE.md"
|
92
93
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
93
94
|
- ".gitignore"
|
@@ -95,6 +96,7 @@ files:
|
|
95
96
|
- ".rubocop.yml"
|
96
97
|
- ".travis.yml"
|
97
98
|
- ".yardopts"
|
99
|
+
- CHANGELOG.md
|
98
100
|
- CODE_OF_CONDUCT.md
|
99
101
|
- CONTRIBUTING.md
|
100
102
|
- Gemfile
|
@@ -102,6 +104,7 @@ files:
|
|
102
104
|
- README.md
|
103
105
|
- Rakefile
|
104
106
|
- bin/console
|
107
|
+
- bin/publish
|
105
108
|
- bin/setup
|
106
109
|
- bin/test
|
107
110
|
- exe/release-notes
|
@@ -143,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
146
|
version: '0'
|
144
147
|
requirements: []
|
145
148
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.7.
|
149
|
+
rubygems_version: 2.7.3
|
147
150
|
signing_key:
|
148
151
|
specification_version: 4
|
149
152
|
summary: Automated release notes for your project
|