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

[WIP] Configure Danger #12

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
declared_trivial = github.pr_title.include? "#trivial"

# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"

# Warn when there is a big PR
warn("Big PR") if git.lines_of_code > 500

# if git.lines_of_code > 3 && !git.modified_files.include?("CHANGELOG.yml")
if !git.modified_files.include?("CHANGELOG.yml") && !declared_trivial
repo_url = github.pr_json['head']['repo']['html_url']
pr_title = github.pr_title
pr_title += '.' unless pr_title.end_with?('.')
pr_number = github.pr_json['number']
pr_url = github.pr_json['html_url']
pr_author = github.pr_author
pr_author_url = "https://github.com/#{pr_author}"

fail("Please include a CHANGELOG entry. \nYou can find it at [CHANGELOG.md](#{repo_url}/blob/master/CHANGELOG.md).")
changelog_msg = <<-CHANGELOG_FORMAT.gsub(/^ *\|/,'')
|Note: we use the following format for CHANGELOG entries:
|```
| * #{pr_title}
| [##{pr_number}](#{pr_url})
| [@#{pr_author}](#{pr_author_url})
|```
|:bulb: Don't forget to use 2 spaces after the full stop at the end of the line describing your changes.
CHANGELOG_FORMAT
markdown(changelog_msg)
end
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
source 'https://rubygems.org'

gem 'cocoapods', '1.2.1'
gem 'danger'
gem 'xcpretty'
37 changes: 37 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ GEM
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
claide (1.0.1)
claide-plugins (0.9.2)
cork
nap
open4 (~> 1.3)
cocoapods (1.2.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.1, < 2.0)
Expand Down Expand Up @@ -42,21 +48,51 @@ GEM
netrc (= 0.7.8)
cocoapods-try (1.1.0)
colored2 (3.1.2)
cork (0.3.0)
colored2 (~> 3.1)
danger (5.1.0)
claide (~> 1.0)
claide-plugins (>= 0.9.2)
colored2 (~> 3.1)
cork (~> 0.1)
faraday (~> 0.9)
faraday-http-cache (~> 1.0)
git (~> 1)
kramdown (~> 1.5)
octokit (~> 4.2)
terminal-table (~> 1)
escape (0.0.4)
faraday (0.12.1)
multipart-post (>= 1.2, < 3)
faraday-http-cache (1.3.1)
faraday (~> 0.8)
fourflusher (2.0.1)
fuzzy_match (2.0.4)
gh_inspector (1.0.3)
git (1.3.0)
i18n (0.8.1)
kramdown (1.13.2)
minitest (5.10.1)
molinillo (0.5.7)
multipart-post (2.0.0)
nanaimo (0.2.3)
nap (1.1.0)
netrc (0.7.8)
octokit (4.7.0)
sawyer (~> 0.8.0, >= 0.5.3)
open4 (1.3.4)
public_suffix (2.0.5)
rouge (1.11.1)
ruby-macho (1.1.0)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
terminal-table (1.7.3)
unicode-display_width (~> 1.1.1)
thread_safe (0.3.6)
tzinfo (1.2.3)
thread_safe (~> 0.1)
unicode-display_width (1.1.3)
xcodeproj (1.4.4)
CFPropertyList (~> 2.3.3)
claide (>= 1.0.1, < 2.0)
Expand All @@ -70,6 +106,7 @@ PLATFORMS

DEPENDENCIES
cocoapods (= 1.2.1)
danger
xcpretty

BUNDLED WITH
Expand Down
2 changes: 2 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ dependencies:
- rake lint:install

test:
pre:
- bundle exec danger
override:
- rake lint:tests
- rake xcode:test
Expand Down