Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions main/githooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ def check_content(files):
return retval


def check_commit_msg(message, files, repo):
def check_commit_msg(message, files):
'''Check commit message (and file size).

Abort if file size exceeds hard (github.com) limit.
Expand All @@ -850,10 +850,6 @@ def check_commit_msg(message, files, repo):
# Not checking for JIRA or large file in commit message generated by github
return 0

if re.match(r'^ccdc-opensource', repo):
# Do not check for JIRA in opensource repo as we don't want to require external contributors to do this
return 0

if NO_JIRA_MARKER not in message:
if jira_id_pattern.search(message) is None:
_fail('Every commit should contain a Jira issue ID or the text '
Expand Down Expand Up @@ -899,7 +895,7 @@ def _test(input, is_jira=True):
class TestCheckCommitMessage(unittest.TestCase):
def test_various_strings(self):
def _test(input, is_good=True):
rc = check_commit_msg(input, [], "dummy/repo")
rc = check_commit_msg(input, [])
self.assertEqual(rc == 0, is_good)
_test('ABC-1234')
_test('Some changes for ABC-1234 ticket')
Expand Down Expand Up @@ -944,6 +940,6 @@ def commit_msg_hook():
commit_message = Path(sys.argv[1]).read_text()

print(' Check commit message ...')
retval += check_commit_msg(commit_message, files['M'] + files['A'], get_repo())
retval += check_commit_msg(commit_message, files['M'] + files['A'])

return retval
Loading