Class: PreCommit::Checks::Coffeelint
- Inherits:
-
Shell
show all
- Defined in:
- lib/plugins/pre_commit/checks/coffeelint.rb
Instance Attribute Summary
Attributes inherited from Plugin
#config, #pluginator
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Plugin
#initialize, #name
Class Method Details
.description ⇒ Object
24
25
26
|
# File 'lib/plugins/pre_commit/checks/coffeelint.rb', line 24
def self.description
"Runs coffeelint to detect errors"
end
|
Instance Method Details
#alternate_config_file ⇒ Object
20
21
22
|
# File 'lib/plugins/pre_commit/checks/coffeelint.rb', line 20
def alternate_config_file
'coffeelint.json'
end
|
#call(staged_files) ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/plugins/pre_commit/checks/coffeelint.rb', line 7
def call(staged_files)
staged_files = staged_files.grep(/\.coffee$/)
return if staged_files.empty?
args = (config_file_flag + staged_files).join(' ')
execute("coffeelint #{args}")
end
|
#config_file_flag ⇒ Object
16
17
18
|
# File 'lib/plugins/pre_commit/checks/coffeelint.rb', line 16
def config_file_flag
config_file ? ['-f', config_file] : []
end
|