Sha256: 7be6af536fef32c326dc901d7e1bbf3e836a361ab2d6f314974ea8bf1742df5a
Contents?: true
Size: 583 Bytes
Versions: 18
Compression:
Stored size: 583 Bytes
Contents
module Overcommit::GitHook class ReleaseNote < HookSpecificCheck include HookRegistry EMPTY_RELEASE_NOTE = /^release notes?\s*[:.]?\n{2,}/im def run_check if commit_message.join =~ EMPTY_RELEASE_NOTE strip_release_note return :warn, 'Empty release note found, automatically removed' end :good end private def strip_release_note stripped_message = commit_message.join.sub(EMPTY_RELEASE_NOTE, '') ::File.open(commit_message_file, 'w') do |file| file.write(stripped_message) end end end end
Version data entries
18 entries across 18 versions & 1 rubygems