Skip to content

Commit 8aa90fd

Browse files
author
Aiden Scandella
committed
s/Causes/Overcommit in prep for gem release
First step in decoupling the functionality from Causes, since it's mostly unrelated. Next steps: - Create bin/overcommit command which will be installed for the gem, supplanting the Rakefile. - Reorganize files for sanity - Gemspec - ??? - Profit Change-Id: I0da05b4c56a1309dd0e26f314f58ce58cbfd710d Reviewed-on: https://gerrit.causes.com/22311 Reviewed-by: Shane da Silva <shane@causes.com> Tested-by: Aiden Scandella <aiden@causes.com>
1 parent 7245f12 commit 8aa90fd

25 files changed

+35
-35
lines changed

lib/base/commit_msg.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require 'rubygems'
22

3-
module Causes
3+
module Overcommit
44
class CommitMessageHook < GitHook::BaseHook
55
# No special behavior
66
end

lib/base/pre_commit.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require 'rubygems'
22
require File.expand_path('../../staged_file', __FILE__)
33

4-
module Causes
4+
module Overcommit
55
class PreCommitHook < GitHook::BaseHook
66
def requires_modified_files?
77
true

lib/causes_hook.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes
1+
module Overcommit
22
module ConsoleMethods
33
def bold(str)
44
puts "\033[1;37m#{str}\033[0m"

lib/file_methods.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes
1+
module Overcommit
22
module FileMethods
33
def modified_files(type=nil, path=nil)
44
@modified_files ||=

lib/git_hook.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
require File.expand_path "../#{dep}", __FILE__
88
end
99

10-
module Causes
10+
module Overcommit
1111
module GitHook
1212
# File.expand_path takes one more '..' than you're used to... we want to
1313
# go two directories up from the caller (which will be .git/hooks/something)
@@ -39,7 +39,7 @@ def initialize
3939
plugin_dirs << REPO_SPECIFIC_DIR if File.directory?(REPO_SPECIFIC_DIR)
4040

4141
plugin_dirs.each do |dir|
42-
Dir[File.join(dir, Causes.hook_name, '*.rb')].each do |plugin|
42+
Dir[File.join(dir, Overcommit.hook_name, '*.rb')].each do |plugin|
4343
require plugin unless skip_checks.include? File.basename(plugin, '.rb')
4444
end
4545
end
@@ -54,7 +54,7 @@ def checks
5454
def run(*args)
5555
exit if requires_modified_files? && modified_files.empty?
5656

57-
puts "Running #{Causes.hook_name} checks"
57+
puts "Running #{Overcommit.hook_name} checks"
5858
results = checks.map do |check_class|
5959
check = check_class.new(*args)
6060
next if check.skip?
@@ -110,13 +110,13 @@ def print_result(results)
110110
puts
111111
case final_result(results)
112112
when :good
113-
success "+++ All #{Causes.hook_name} checks passed"
113+
success "+++ All #{Overcommit.hook_name} checks passed"
114114
exit 0
115115
when :bad
116-
error "!!! One or more #{Causes.hook_name} checks failed"
116+
error "!!! One or more #{Overcommit.hook_name} checks failed"
117117
exit 1
118118
when :stop
119-
warning "*** One or more #{Causes.hook_name} checks needs attention"
119+
warning "*** One or more #{Overcommit.hook_name} checks needs attention"
120120
warning "*** If you really want to commit, use SKIP_CHECKS"
121121
warning "*** (takes a space-separated list of checks to skip, or 'all')"
122122
exit 1

lib/hook_runner.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
require File.expand_path "../#{dep}", Pathname.new(__FILE__).realpath
1111
end
1212

13-
Causes.load_hooks
14-
Causes::GitHook.run_hooks(*ARGV)
13+
Overcommit.load_hooks
14+
Overcommit::GitHook.run_hooks(*ARGV)

lib/hook_specific_check.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes
1+
module Overcommit
22
module GitHook
33
module HookRegistry
44
@checks = []
@@ -26,7 +26,7 @@ def initialize(*args)
2626
end
2727

2828
def name
29-
Causes.underscorize self.class.name.to_s.split('::').last
29+
Overcommit.underscorize self.class.name.to_s.split('::').last
3030
end
3131

3232
def skip?

lib/plugins/commit_msg/change_id.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class ChangeID < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/commit_msg/release_note.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class ReleaseNote < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/commit_msg/russian_novel.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class RussianNovel < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/commit_msg/text_width.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class TextWidth < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/commit_msg/trailing_period.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class TrailingPeriod < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/pre_commit/check_commit_author.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class CheckCommitAuthor < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/pre_commit/css_linter.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class CssLinter < HookSpecificCheck
33
include HookRegistry
44
file_type :css
55

6-
CSS_LINTER_PATH = File.join(Causes.scripts_path, 'csslint-rhino.js')
6+
CSS_LINTER_PATH = File.join(Overcommit.scripts_path, 'csslint-rhino.js')
77

88
def run_check
99
return :warn, "Rhino is not installed" unless in_path? 'rhino'

lib/plugins/pre_commit/erb_syntax.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class ErbSyntax < HookSpecificCheck
33
include HookRegistry
44
file_type :erb

lib/plugins/pre_commit/haml_syntax.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
puts "'haml' gem not available"
55
end
66

7-
module Causes::GitHook
7+
module Overcommit::GitHook
88
class HamlSyntax < HookSpecificCheck
99
include HookRegistry
1010
file_type :haml

lib/plugins/pre_commit/js_console_log.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class JSConsoleLog < HookSpecificCheck
33
include HookRegistry
44
file_type :js

lib/plugins/pre_commit/js_syntax.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class JSSyntax < HookSpecificCheck
33
include HookRegistry
44
file_type :js
55

6-
JS_HINT_PATH = File.join(Causes.scripts_path, 'jshint.js')
7-
JS_HINT_RUNNER_PATH = File.join(Causes.scripts_path, 'jshint_runner.js')
6+
JS_HINT_PATH = File.join(Overcommit.scripts_path, 'jshint.js')
7+
JS_HINT_RUNNER_PATH = File.join(Overcommit.scripts_path, 'jshint_runner.js')
88

99
def run_check
1010
return :warn, "Rhino is not installed" unless in_path? 'rhino'

lib/plugins/pre_commit/restricted_paths.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class RestrictedPaths < HookSpecificCheck
33
include HookRegistry
44
RESTRICTED_PATHS = %w[vendor]

lib/plugins/pre_commit/ruby_syntax.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class RubySyntax < HookSpecificCheck
33
include HookRegistry
44
file_type :rb

lib/plugins/pre_commit/scss_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class ScssLint < HookSpecificCheck
33
include HookRegistry
44
file_type :scss

lib/plugins/pre_commit/test_history.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class TestHistory < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/pre_commit/whitespace.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class Whitespace < HookSpecificCheck
33
include HookRegistry
44

lib/plugins/pre_commit/yaml_syntax.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module Causes::GitHook
1+
module Overcommit::GitHook
22
class YamlSyntax < HookSpecificCheck
33
include HookRegistry
44
file_type :yml

lib/staged_file.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# the index, not the one in the work tree. This class is a simple wrapper
33
# to make working with staged files easier.
44

5-
module Causes
5+
module Overcommit
66
class StagedFile
77
attr_reader :contents
88

0 commit comments

Comments
 (0)