Skip to content

Commit 947106f

Browse files
authored
feature: add commit message format to handle release note smarter (#616)
* feature: add commit message format to handle release note smarter * collect skiping release note flow
1 parent d126ba1 commit 947106f

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

Rakefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ task :notes do
212212
hex = line.match(/[a-zA-Z0-9]+/)[0]
213213
# use first 7 chars to match GitHub
214214
comment = line.gsub(hex, '').strip
215-
next if comment == 'Update release notes'
215+
next if skip_release_note?(comment)
216216

217217
issue_num = comment.slice(/\(#[0-9]+\)/)
218218
# If the issue_num is pull request, GitHub redirects to the pull request.
@@ -222,6 +222,7 @@ task :notes do
222222
else
223223
comment
224224
end
225+
225226
new_data += "- [#{hex[0...7]}](https://github.com/appium/#{gh_name}/commit/#{hex}) #{comment_note}\n"
226227
end
227228
data = new_data + "\n"
@@ -233,6 +234,13 @@ task :notes do
233234
File.open('release_notes.md', 'w') { |f| f.write notes.to_s.strip }
234235
end
235236

237+
# Return true if the comment is equal to 'Update release notes'
238+
# Return true if the comment starts with /^(docs|style|chore):/
239+
def skip_release_note?(comment)
240+
return true if comment == 'Update release notes'
241+
comment =~ /^(docs|style|chore|test):/ ? true : false
242+
end
243+
236244
# Used to purge byte order marks that mess up YARD
237245
def remove_non_ascii
238246
Dir.glob('./**/*.rb') do |path|

contributing.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,20 @@ Android tests require running on physical hardware with Android 5.0 (API 21). Th
2222
- `cd android_tests`
2323
- `flake 3 android` - Run all the Android tests up to 3 times
2424

25-
### Publishing
25+
## Commit Message Format
26+
- `#{type}: some commit messages`
27+
- `docs`, `style`, `test` and `chore` are ignored when generating release note with `rake release`.
28+
29+
### Type
30+
- `feature`: A new feature
31+
- `fix`: A bug fix
32+
- `docs`: Documentation only changes
33+
- `style`: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
34+
- `refactor`: A code change that neither fixes a bug nor adds a feature
35+
- `test`: Adding missing or correcting existing tests
36+
- `chore`: Changes to the build process or auxiliary tools and libraries such as documentation generation
37+
38+
## Publishing
2639

2740
0. Ensure you have `~/.gem/credentials` If not run [the following command](http://guides.rubygems.org/make-your-own-gem/) (replace username with your rubygems user)
2841
> $ curl -u username https://rubygems.org/api/v1/api_key.yaml >

0 commit comments

Comments
 (0)