Skip to content

Commit 1d56669

Browse files
authored
Merge pull request #11 from Moya/release-party
Getting ready for our first release
2 parents 611f221 + 5103721 commit 1d56669

File tree

6 files changed

+77
-3
lines changed

6 files changed

+77
-3
lines changed

.rubocop.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
AllCops:
2-
DisplayCopNames: true
3-
41
Metrics/LineLength:
52
Max: 120
63

Changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
3+
## Current master branch
4+
5+
- Nothing yet!
6+
7+
## 0.1.0
8+
9+
- Initial release of Aeryn.

Dangerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
has_app_changes = !git.modified_files.grep(/lib/).empty?
2+
has_test_changes = !git.modified_files.grep(/spec/).empty?
3+
4+
# Sometimes it's a README fix, or something like that - which isn't relevant for
5+
# including in a project's CHANGELOG for example
6+
declared_trivial = pr_title.include? '#trivial'
7+
8+
# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
9+
warn('PR is classed as Work in Progress') if pr_title.include? '[WIP]'
10+
11+
# Warn when there is a big PR
12+
warn('Big PR') if lines_of_code > 500
13+
14+
# Add a CHANGELOG entry for app changes
15+
if !modified_files.include?('CHANGELOG.md') && has_app_changes
16+
fail('Please include a CHANGELOG entry.')
17+
end
18+
19+
# Warn about un-updated tests
20+
if has_app_changes && !has_test_changes
21+
warn 'Tests were not updated'
22+
end
23+
24+
if github.pr_body.length < 5
25+
fail 'Please provide a summary in the Pull Request description'
26+
end
27+
28+
# TODO: This could be a danger plugin
29+
files_to_lint = (modified_files + added_files).select { |f| f.end_with? 'rb' }
30+
rubocop_results = files_to_lint.map { |f| JSON.parse(`bundle exec rubocop -f json #{f}`)['files'] }.flatten
31+
offending_files = rubocop_results.select { |f| f['offenses'].count > 0 }
32+
33+
unless offending_files.empty?
34+
message = '### Rubocop violations'
35+
message << 'File | Line | Reason |\n'
36+
message << '| --- | ----- | ----- |\n'
37+
38+
offending_files.each do |f|
39+
f['offenses'].each do |o|
40+
message << "#{f['path']} | #{o['location']['line']} | #{o['message']} \n"
41+
end
42+
end
43+
44+
markdown message
45+
end

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,6 @@ group :test do
1818
gem 'guard-rspec'
1919
gem 'capybara'
2020
gem 'rspec-mocks'
21+
22+
gem 'danger'
2123
end

Gemfile.lock

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,27 @@ GEM
99
rack (>= 1.0.0)
1010
rack-test (>= 0.5.4)
1111
xpath (~> 2.0)
12+
claide (1.0.0)
1213
coderay (1.1.1)
14+
colored (1.2)
15+
cork (0.1.0)
16+
colored (~> 1.2)
17+
danger (0.8.4)
18+
claide (~> 1.0)
19+
colored (~> 1.2)
20+
cork (~> 0.1)
21+
faraday (~> 0)
22+
git (~> 1)
23+
octokit (~> 4.2)
24+
redcarpet (~> 3.3)
25+
terminal-table (~> 1)
1326
diff-lcs (1.2.5)
1427
extlib (0.9.16)
1528
faraday (0.9.2)
1629
multipart-post (>= 1.2, < 3)
1730
ffi (1.9.10)
1831
formatador (0.2.5)
32+
git (1.3.0)
1933
guard (2.14.0)
2034
formatador (>= 0.2.4)
2135
listen (>= 2.7, < 4.0)
@@ -70,6 +84,7 @@ GEM
7084
rb-fsevent (0.9.7)
7185
rb-inotify (0.9.7)
7286
ffi (>= 0.5.0)
87+
redcarpet (3.3.4)
7388
rspec (3.5.0)
7489
rspec-core (~> 3.5.0)
7590
rspec-expectations (~> 3.5.0)
@@ -106,6 +121,7 @@ GEM
106121
diff-lcs (>= 1.1.2)
107122
extlib (>= 0.9.5)
108123
highline (>= 1.4.0)
124+
terminal-table (1.6.0)
109125
thor (0.19.1)
110126
tilt (2.0.5)
111127
unicode-display_width (1.1.0)
@@ -117,6 +133,7 @@ PLATFORMS
117133

118134
DEPENDENCIES
119135
capybara
136+
danger
120137
guard-rspec
121138
guard-rubocop
122139
json

circle.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
test:
2+
override:
3+
- bundle exec rspec
4+
- bundle exec danger

0 commit comments

Comments
 (0)