Skip to content

Commit

Permalink
small Danger/oss-check improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsim committed Feb 3, 2017
1 parent 7c320af commit da7712b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ warn('Big PR') if git.lines_of_code > 500
# including in a CHANGELOG for example
has_app_changes = !git.modified_files.grep(/Source/).empty?
has_test_changes = !git.modified_files.grep(/Tests/).empty?
has_dangerfile_changes = !git.modified_files.grep(/Dangerfile/).empty?
has_danger_changes = !git.modified_files.grep(/Dangerfile|script\/oss-check/).empty?

# Add a CHANGELOG entry for app changes
if !git.modified_files.include?('CHANGELOG.md') && has_app_changes
Expand All @@ -29,7 +29,7 @@ if git.lines_of_code > 50 && has_app_changes && !has_test_changes
end

# Run OSSCheck if there were app changes
if has_app_changes || has_dangerfile_changes
if has_app_changes || has_danger_changes
def non_empty_lines(lines)
lines.split(/\n+/).reject(&:empty?)
end
Expand Down
5 changes: 5 additions & 0 deletions script/oss-check
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ end

@branch_name = `git symbolic-ref HEAD --short`.strip

if @branch_name == 'master'
fail "can't run osscheck from 'master' as the script compares "\
"the performance of this branch against 'master'"
end

@repos = [
'Alamofire/Alamofire',
'apple/swift',
Expand Down

0 comments on commit da7712b

Please sign in to comment.