$newrev = ARGV[2]
$user = ENV['USER']
+if ENV.has_key?('GL_OPTION_SKIP_CODING_STANDARDS_CHECK')
+ puts "Skipping coding standards check..."
+ exit 0
+end
+
def blacklist bl
if ($newrev[0,6] == '000000')
# A branch is being deleted. Do not check old commits for DCO signoff!
$regex = /\[ref: (\d+)\]/
$broken_commit_message = /Please enter a commit message to explain why this merge is necessary/
-$wrong_way_merge_main = /Merge( remote-tracking)? branch '([^\/]+\/)?master' into/
-$merge_main = /Merge branch '[^']+'((?! into)| into master)/
+$wrong_way_merge_main = /Merge( remote-tracking)? branch '([^\/]+\/)?main' into/
+$merge_main = /Merge branch '[^']+'((?! into)| into main)/
$pull_merge = /Merge branch 'main' of /
-$refs_or_closes_or_no_issue = /(refs #|closes #|fixes #|no issue #)/i
+$refs_or_closes_or_no_issue = /(refs #|closes #|fixes #|resolves #|no issue #)/i
# enforced custom commit message format
def check_message_format
no_ff = true
elsif $pull_merge.match(message)
puts "\n[POLICY] This appears to be a git pull merge of remote main into local"
- puts "main. In order to maintain a linear first-parent history of master,"
+ puts "main. In order to maintain a linear first-parent history of main,"
puts "please reset your branch and remerge or rebase using the latest main.\n"
puts "\n******************************************************************\n"
puts "\nOffending commit: #{rev}\n"
# this test will complain about *every* commit in the merge otherwise, obscuring
# the real reason for the rejection (the no_ff merge)
if not no_ff and not $refs_or_closes_or_no_issue.match(message)
- puts "\n[POLICY] All commits to main must include an issue using \"refs #\" or"
- puts "\"closes #\", or specify \"no issue #\"\n"
+ puts "\n[POLICY] All commits to main must include an issue using \"refs #\","
+ puts "\"fixes #\", \"closes #\", or \"resolves #\", or specify \"no issue #\"\n"
puts "\n******************************************************************\n"
puts "\nOffending commit: #{rev}\n"
puts "\nOffending commit message:\n\n"