Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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 github.pr_title.include? "[WIP]"
- # Warn when there is a big PR
- warn("Big PR") if git.lines_of_code > 500
- # Ensure a clean commits history
- if git.commits.any? { |c| c.message =~ /^Merge branch '#{github.branch_for_base}'/ }
- fail('Please rebase to get rid of the merge commits in this PR')
- end
- # Mainly to encourage writing up some reasoning about the PR, rather than
- # just leaving a title
- if github.pr_body.length < 5
- fail "Please provide a summary in the Pull Request description"
- end
- # If these are all empty something has gone wrong, better to raise it in a comment
- if git.modified_files.empty? && git.added_files.empty? && git.deleted_files.empty?
- fail "This PR has no changes at all, this is likely an issue during development."
- end
- has_app_changes = !git.modified_files.grep(/ProjectName/).empty?
- has_test_changes = !git.modified_files.grep(/ProjectName/).empty?
- if has_app_changes && !has_test_changes
- warn("Tests were not updated", sticky: false)
- end
- is_plist_change = git.modified_files.sort == ["ProjectName/Info.plist"].sort
- if !is_plist_change
- warn("Plist changed, don't forget to localize your plist values")
- end
- podfile_updated = !git.modified_files.grep(/Podfile/).empty?
- if podfile_updated
- warn("The `Podfile` was updated")
- end
- swiftlint.lint_files
- swiftlint.lint_files inline_mode: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement