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.5.0 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.4.1 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.4.0 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.3.2 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.3.1 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.3.0 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.2.6 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.2.5 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.2.4 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.2.3 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.2.2 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.2.1 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.2.0 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.11 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.10 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.9 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.8 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.7 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.6 lib/overcommit/plugins/pre_commit/author_name.rb
overcommit-0.1.5 lib/overcommit/plugins/pre_commit/author_name.rb