Sha256: a40dd67bda694e60ab19751cae84e52da864b5dfc08014e265cfa899818dd49e

Contents?: true

Size: 444 Bytes

Versions: 25

Compression:

Stored size: 444 Bytes

Contents

module Overcommit::GitHook
  class AuthorName < HookSpecificCheck
    include HookRegistry

    def run_check
      name = `git config --get user.name`.chomp
      unless name.split(' ').count >= 2
        return :bad, "Author must have at least first and last name; " <<
                     "was: '#{name}'.\n Set your name with " <<
                     "`git config --global user.name 'Your Name'`"
      end

      :good
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
overcommit-0.1.4 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.3 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.2 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.1 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.0 lib/overcommit/plugins/pre_commit/author_name.rb