Skip to content

Commit

Permalink
Fix Danger check for updated rules documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelofabri committed Jul 13, 2017
1 parent 93b130f commit 686279c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ require 'open3'
# Warn when there is a big PR
warn('Big PR') if git.lines_of_code > 500

modified_files = git.modified_files + git.added_files

# Sometimes its a README fix, or something like that - which isn't relevant for
# 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_danger_changes = !git.modified_files.grep(/Dangerfile|script\/oss-check|Gemfile/).empty?
has_build_changes = !git.modified_files.grep(/Makefile|SwiftLint\.xcodeproj|SwiftLint\.xcworkspace|Package\.swift|Cartfile/).empty?
has_danger_changes = !git.modified_files.grep(/Dangerfile|script\/oss-check|Gemfile/).empty?
has_rules_changes = !git.modified_files.grep('/Source/SwiftLintFramework/Rules/').empty?
has_rules_docs_changes = !git.modified_files.grep('Rules.md').empty?
has_app_changes = !modified_files.grep(/Source/).empty?
has_test_changes = !modified_files.grep(/Tests/).empty?
has_danger_changes = !modified_files.grep(/Dangerfile|script\/oss-check|Gemfile/).empty?
has_build_changes = !modified_files.grep(/Makefile|SwiftLint\.xcodeproj|SwiftLint\.xcworkspace|Package\.swift|Cartfile/).empty?
has_danger_changes = !modified_files.grep(/Dangerfile|script\/oss-check|Gemfile/).empty?
has_rules_changes = !modified_files.grep(/Source\/SwiftLintFramework\/Rules/).empty?
has_rules_docs_changes = !modified_files.grep(/Rules\.md/).empty?

# Add a CHANGELOG entry for app changes
if !git.modified_files.include?('CHANGELOG.md') && has_app_changes
Expand Down

0 comments on commit 686279c

Please sign in to comment.