tighten up commit message linting

in spite of the only_report_errors list, this should be something everyone
can agree on

test plan:
* spec-only commits and commit messages should be linted whether or not the
  commiter is in the only_report_errors list

Change-Id: I077173db60f9f537d14f66b7acd396823e10a395
Reviewed-on: https://gerrit.instructure.com/65830
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
This commit is contained in:
Jon Jensen 2015-10-26 11:44:42 -06:00
parent 57d9781b4a
commit b3e0fc8309
1 changed files with 7 additions and 7 deletions

View File

@ -84,13 +84,6 @@ if is_a_selinimum_test.size > 1
comment "error", line, "since you're telling selinimum to ignore intermediate commits, this commit may not be safe to merge"
end
user_config_file = File.expand_path("../../gems/rubocop-canvas/config/gergich_user_config.yml", __FILE__)
if File.exists?(user_config_file)
config = YAML.load_file(user_config_file) || {}
user_list = config['only_report_errors'] || []
exit if user_list.include?(ENV['GERRIT_EVENT_ACCOUNT_EMAIL'])
end
starts_with_spec = subject =~ /\Aspec: /i
exit if starts_with_spec # we're trusting you here, don't be evil
@ -101,6 +94,13 @@ if only_affects_specs
exit
end
user_config_file = File.expand_path("../../gems/rubocop-canvas/config/gergich_user_config.yml", __FILE__)
if File.exists?(user_config_file)
config = YAML.load_file(user_config_file) || {}
user_list = config['only_report_errors'] || []
exit if user_list.include?(ENV['GERRIT_EVENT_ACCOUNT_EMAIL'])
end
issue_ids = JiraRefParser.scan_message_for_issue_ids(commit_message)
if issue_ids.empty?
parts = commit_message.split(/([A-Z]+-[0-9]+)/)