Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. # Make it more obvious that a PR is a work in progress and shouldn't be merged yet
  2. warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"
  3.  
  4. # Warn when there is a big PR
  5. warn("Big PR") if git.lines_of_code > 500
  6.  
  7. # Ensure a clean commits history
  8. if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ }
  9. fail('Please rebase to get rid of the merge commits in this PR')
  10. end
  11.  
  12. # Mainly to encourage writing up some reasoning about the PR, rather than
  13. # just leaving a title
  14. if github.pr_body.length < 5
  15. fail "Please provide a summary in the Pull Request description"
  16. end
  17.  
  18. # If these are all empty something has gone wrong, better to raise it in a comment
  19. if git.modified_files.empty? && git.added_files.empty? && git.deleted_files.empty?
  20. fail "This PR has no changes at all, this is likely an issue during development."
  21. end
  22.  
  23. has_app_changes = !git.modified_files.grep(/ProjectName/).empty?
  24. has_test_changes = !git.modified_files.grep(/ProjectName/).empty?
  25.  
  26. if has_app_changes && !has_test_changes
  27. warn("Tests were not updated", sticky: false)
  28. end
  29.  
  30. is_plist_change = git.modified_files.sort == ["ProjectName/Info.plist"].sort
  31.  
  32. if !is_plist_change
  33. warn("Plist changed, don't forget to localize your plist values")
  34. end
  35.  
  36. podfile_updated = !git.modified_files.grep(/Podfile/).empty?
  37.  
  38. if podfile_updated
  39. warn("The `Podfile` was updated")
  40. end
  41.  
  42. swiftlint.lint_files
  43. swiftlint.lint_files inline_mode: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement