Sha256: b36b3970ab5ed24cd4599fd14e4be81beb82e74494dfe3909a3ccd6a1f76faa0

Contents?: true

Size: 1.63 KB

Versions: 130

Compression:

Stored size: 1.63 KB

Contents

# 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
can_merge = github.pr_json["mergeable"]
is_merged = github.pr_json["merged"]

if is_merged
  warn("This PR was merged before CI was done.", sticky: false)
else
  warn("This PR cannot be merged yet.", sticky: false) unless can_merge
end

# 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 THERE IS A SUMMARY FOR A PR
warn("Please provide a summary in the Pull Request description. See more info <a href=\"http\://tinyletter.com/exercism/letters/exercism-pull-requests\">here.</a>") if github.pr_body.length < 5

# LINT Comments in for each Line
jsonpath = "lintreport.json"
contents = File.read jsonpath
require "json"
if contents.to_s == ''
	contents = "[]"
end
json = JSON.parse contents
json.each do |object|
   shortFile =  object["file"]
   shortFile.sub! "/Users/travis/build/exercism/swift/", ''
   shortFile = shortFile.to_s || ''
   msg = object["reason"].to_s || ''
   severity = object["severity"].to_s || ''
   isError = severity == "Error"
   line = object["line"] || 1
   #only warn for files that were edited in this PR.
   if isError
    warn(msg, file: "/" + shortFile, line: line) if isError
   elsif git.modified_files.include? shortFile
   	warn(msg, file: "/" + shortFile, line: line) unless isError
   else
   	message(msg, file: shortFile, line: line)
   end
end

Version data entries

130 entries across 130 versions & 1 rubygems

Version Path
trackler-2.2.1.121 tracks/swift/Dangerfile
trackler-2.2.1.120 tracks/swift/Dangerfile
trackler-2.2.1.119 tracks/swift/Dangerfile
trackler-2.2.1.118 tracks/swift/Dangerfile
trackler-2.2.1.117 tracks/swift/Dangerfile
trackler-2.2.1.116 tracks/swift/Dangerfile
trackler-2.2.1.115 tracks/swift/Dangerfile
trackler-2.2.1.114 tracks/swift/Dangerfile
trackler-2.2.1.113 tracks/swift/Dangerfile
trackler-2.2.1.111 tracks/swift/Dangerfile
trackler-2.2.1.110 tracks/swift/Dangerfile
trackler-2.2.1.109 tracks/swift/Dangerfile
trackler-2.2.1.108 tracks/swift/Dangerfile
trackler-2.2.1.107 tracks/swift/Dangerfile
trackler-2.2.1.106 tracks/swift/Dangerfile
trackler-2.2.1.105 tracks/swift/Dangerfile
trackler-2.2.1.104 tracks/swift/Dangerfile
trackler-2.2.1.103 tracks/swift/Dangerfile
trackler-2.2.1.102 tracks/swift/Dangerfile
trackler-2.2.1.101 tracks/swift/Dangerfile