Module: PreCommit

Defined in:
lib/pre-commit.rb,
lib/pre-commit/cli.rb,
lib/pre-commit/line.rb,
lib/pre-commit/runner.rb,
lib/pre-commit/message.rb,
lib/pre-commit/template.rb,
lib/pre-commit/checks/js.rb,
lib/pre-commit/installer.rb,
lib/pre-commit/error_list.rb,
lib/pre-commit/checks/grep.rb,
lib/pre-commit/checks/shell.rb,
lib/pre-commit/plugins_list.rb,
lib/pre-commit/checks/plugin.rb,
lib/pre-commit/configuration.rb,
lib/pre-commit/list_evaluator.rb,
lib/plugins/pre_commit/checks/ci.rb,
lib/plugins/pre_commit/checks/go.rb,
lib/plugins/pre_commit/checks/pry.rb,
lib/pre-commit/utils/staged_files.rb,
lib/plugins/pre_commit/checks/json.rb,
lib/plugins/pre_commit/checks/ruby.rb,
lib/plugins/pre_commit/checks/tabs.rb,
lib/plugins/pre_commit/checks/yaml.rb,
lib/plugins/pre_commit/checks/local.rb,
lib/plugins/pre_commit/checks/rails.rb,
lib/plugins/pre_commit/checks/common.rb,
lib/plugins/pre_commit/checks/go_fmt.rb,
lib/plugins/pre_commit/checks/jshint.rb,
lib/plugins/pre_commit/checks/jslint.rb,
lib/pre-commit/utils/git_conversions.rb,
lib/plugins/pre_commit/checks/csslint.rb,
lib/plugins/pre_commit/checks/rubocop.rb,
lib/plugins/pre_commit/checks/debugger.rb,
lib/plugins/pre_commit/checks/go_build.rb,
lib/plugins/pre_commit/checks/nb_space.rb,
lib/pre-commit/configuration/providers.rb,
lib/pre-commit/configuration/top_level.rb,
lib/plugins/pre_commit/checks/migration.rb,
lib/plugins/pre_commit/checks/scss_lint.rb,
lib/plugins/pre_commit/checks/before_all.rb,
lib/plugins/pre_commit/checks/coffeelint.rb,
lib/plugins/pre_commit/checks/whitespace.rb,
lib/pre-commit/checks/plugin/config_file.rb,
lib/plugins/pre_commit/checks/console_log.rb,
lib/plugins/pre_commit/checks/rspec_focus.rb,
lib/plugins/pre_commit/checks/gemfile_path.rb,
lib/plugins/pre_commit/checks/merge_conflict.rb,
lib/plugins/pre_commit/configuration/providers/env.rb,
lib/plugins/pre_commit/configuration/providers/git.rb,
lib/plugins/pre_commit/configuration/providers/yaml.rb,
lib/plugins/pre_commit/checks/ruby_symbol_hashrockets.rb,
lib/plugins/pre_commit/configuration/providers/default.rb,
lib/plugins/pre_commit/configuration/providers/git_old.rb

Overview

The pre-commit gem.

Defined Under Namespace

Modules: Checks, Utils Classes: CanNotUpdateDefauls, Cli, Configuration, ErrorList, Installer, Line, ListEvaluator, Message, NotAnArray, PluginNotFound, PluginsList, Runner, Template

Constant Summary collapse

TemplateNotFound =
Class.new(StandardError)

Class Method Summary collapse

Class Method Details

.checks_to_runObject

Can not delete this method with out a deprecation strategy. It is refered to in the generated pre-commit hook in versions 0.0-0.1.1

NOTE: The deprecation strategy may be just delete it since, we’re still pre 1.0.

Actually, on the deprecation note. This method isn’t really the problem. The problem is the default generated pre-commit hook. It shouldn’t have logic in it. The we have freedom to change the gem implementation however we want, and nobody is forced to update their pre-commit binary.



18
19
20
21
# File 'lib/pre-commit.rb', line 18

def self.checks_to_run
  warn "WARNING: You are using old hook version, you can update it with: pre-commit install"
  runner.list_to_run(:checks)
end

.pluginatorObject



3
4
5
# File 'lib/pre-commit/plugins_list.rb', line 3

def self.pluginator
  Pluginator.find('pre_commit', :extends => [:find_check])
end

.runObject



23
24
25
# File 'lib/pre-commit.rb', line 23

def self.run
  runner.run or exit 1
end

.runnerObject



27
28
29
# File 'lib/pre-commit.rb', line 27

def self.runner
  @runner ||= PreCommit::Runner.new
end