-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Moya/release-party
Getting ready for our first release
- Loading branch information
Showing
6 changed files
with
77 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
AllCops: | ||
DisplayCopNames: true | ||
|
||
Metrics/LineLength: | ||
Max: 120 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,6 @@ group :test do | |
gem 'guard-rspec' | ||
gem 'capybara' | ||
gem 'rspec-mocks' | ||
|
||
gem 'danger' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
test: | ||
override: | ||
- bundle exec rspec | ||
- bundle exec danger |