Class: PreCommit::Checks::Ci

Inherits:
Plugin
  • Object
show all
Defined in:
lib/plugins/pre_commit/checks/ci.rb

Constant Summary collapse

CI_TASK_NAME =
'pre_commit:ci'

Instance Attribute Summary

Attributes inherited from Plugin

#config, #pluginator

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Plugin

#initialize, #name

Constructor Details

This class inherits a constructor from PreCommit::Checks::Plugin

Class Method Details

.descriptionObject


15
16
17
# File 'lib/plugins/pre_commit/checks/ci.rb', line 15

def self.description
  "Runs 'rake #{CI_TASK_NAME} --silent'"
end

Instance Method Details

#call(_) ⇒ Object


8
9
10
11
12
13
# File 'lib/plugins/pre_commit/checks/ci.rb', line 8

def call(_)
  return if system("rake #{Ci::CI_TASK_NAME} --silent")
  PreCommit::ErrorList.new(
    "your test suite has failed, for the full output run `#{CI_TASK_NAME}`"
  )
end