Skip to content

Commit

Permalink
Merge pull request #11 from Moya/release-party
Browse files Browse the repository at this point in the history
Getting ready for our first release
  • Loading branch information
orta authored Jul 4, 2016
2 parents 611f221 + 5103721 commit 1d56669
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
AllCops:
DisplayCopNames: true

Metrics/LineLength:
Max: 120

Expand Down
9 changes: 9 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## Current master branch

- Nothing yet!

## 0.1.0

- Initial release of Aeryn.
45 changes: 45 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
has_app_changes = !git.modified_files.grep(/lib/).empty?
has_test_changes = !git.modified_files.grep(/spec/).empty?

# 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 = 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 pr_title.include? '[WIP]'

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

# Add a CHANGELOG entry for app changes
if !modified_files.include?('CHANGELOG.md') && has_app_changes
fail('Please include a CHANGELOG entry.')
end

# Warn about un-updated tests
if has_app_changes && !has_test_changes
warn 'Tests were not updated'
end

if github.pr_body.length < 5
fail 'Please provide a summary in the Pull Request description'
end

# TODO: This could be a danger plugin
files_to_lint = (modified_files + added_files).select { |f| f.end_with? 'rb' }
rubocop_results = files_to_lint.map { |f| JSON.parse(`bundle exec rubocop -f json #{f}`)['files'] }.flatten
offending_files = rubocop_results.select { |f| f['offenses'].count > 0 }

unless offending_files.empty?
message = '### Rubocop violations'
message << 'File | Line | Reason |\n'
message << '| --- | ----- | ----- |\n'

offending_files.each do |f|
f['offenses'].each do |o|
message << "#{f['path']} | #{o['location']['line']} | #{o['message']} \n"
end
end

markdown message
end
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ group :test do
gem 'guard-rspec'
gem 'capybara'
gem 'rspec-mocks'

gem 'danger'
end
17 changes: 17 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
claide (1.0.0)
coderay (1.1.1)
colored (1.2)
cork (0.1.0)
colored (~> 1.2)
danger (0.8.4)
claide (~> 1.0)
colored (~> 1.2)
cork (~> 0.1)
faraday (~> 0)
git (~> 1)
octokit (~> 4.2)
redcarpet (~> 3.3)
terminal-table (~> 1)
diff-lcs (1.2.5)
extlib (0.9.16)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.10)
formatador (0.2.5)
git (1.3.0)
guard (2.14.0)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
Expand Down Expand Up @@ -70,6 +84,7 @@ GEM
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
redcarpet (3.3.4)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
Expand Down Expand Up @@ -106,6 +121,7 @@ GEM
diff-lcs (>= 1.1.2)
extlib (>= 0.9.5)
highline (>= 1.4.0)
terminal-table (1.6.0)
thor (0.19.1)
tilt (2.0.5)
unicode-display_width (1.1.0)
Expand All @@ -117,6 +133,7 @@ PLATFORMS

DEPENDENCIES
capybara
danger
guard-rspec
guard-rubocop
json
Expand Down
4 changes: 4 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test:
override:
- bundle exec rspec
- bundle exec danger

0 comments on commit 1d56669

Please sign in to comment.