Skip to content
Merged
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
14 changes: 7 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,9 +850,9 @@ 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 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:
Expand Down Expand Up @@ -899,7 +899,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 +944,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
return retval
Loading