Class: Overcommit::GitHook::ReleaseNote

Inherits:
HookSpecificCheck show all
Includes:
HookRegistry
Defined in:
lib/overcommit/plugins/commit_msg/release_note.rb

Constant Summary collapse

EMPTY_RELEASE_NOTE =
/^release notes?\s*[:.]?\n{2,}/im

Instance Method Summary collapse

Methods included from HookRegistry

included

Methods inherited from HookSpecificCheck

friendly_name, #initialize, #name, required!, #skip?, skippable?, #staged, stealth!, #stealth?

Constructor Details

This class inherits a constructor from Overcommit::GitHook::HookSpecificCheck

Instance Method Details

#run_checkObject



6
7
8
9
10
11
12
13
# File 'lib/overcommit/plugins/commit_msg/release_note.rb', line 6

def run_check
  if commit_message.join =~ EMPTY_RELEASE_NOTE
    strip_release_note
    return :warn, 'Empty release note found, automatically removed'
  end

  :good
end