Skip to content
This repository was archived by the owner on Sep 6, 2018. It is now read-only.

Commit f4855f2

Browse files
AliSoftwaredjbe
authored andcommitted
More dynamic suggestions
1 parent e33b550 commit f4855f2

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

Dangerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,22 @@ warn("Big PR") if git.lines_of_code > 500
1010

1111
# if git.lines_of_code > 3 && !git.modified_files.include?("CHANGELOG.yml")
1212
if !git.modified_files.include?("CHANGELOG.yml") && !declared_trivial
13-
fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](https://github.com/SwiftGen/SwiftGen/blob/master/CHANGELOG.md).")
13+
repo_url = github.pr_json['head']['repo']['html_url']
14+
pr_number = github.pr_json['number']
15+
pr_url = github.pr_json['html_url']
16+
pr_title = github.pr_title.sub(/[?.!,;]?$/, '').capitalize
17+
pr_author = github.pr_author
18+
pr_author_url = "https://github.com/#{github.pr_author}"
19+
20+
fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](#{repo_url}/blob/master/CHANGELOG.md).")
1421
changelog_msg = <<-CHANGELOG_FORMAT.gsub(/^ *\|/,'')
1522
|Note: we use the following format for CHANGELOG entries:
1623
|```
17-
| * Describe your change here. Don’t forget to use 2 spaces at the end
18-
| of the last line describing your change.
19-
| [#nn](https://github.com/SwiftGen/SwiftGen/pull/nn)
24+
| * #{pr_title}
25+
| [##{pr_number}](#{pr_url})
26+
| [@#{pr_author}](#{pr_author_url})
2027
|```
28+
|:bulb: Don't forget to use 2 spaces after the full stop at the end of the line describing your changes.
2129
CHANGELOG_FORMAT
2230
markdown(changelog_msg)
2331
end

0 commit comments

Comments
 (0)