Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/chamber_security.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://github.com/thekompanee/chamber
class ChamberSecurity < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)

return :pass if result.stdout.empty?
[:fail, "These settings appear to need to be secured but were not: #{result.stdout}"]
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/coffee_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CoffeeLint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
parse_messages(result.stdout)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/css_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CssLint < Base
/x

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp
return :pass if result.success? && output.empty?

Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/es_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see http://eslint.org/
class EsLint < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp
return :pass if result.success? && output.empty?

Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/go_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://github.com/golang/lint
class GoLint < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout + result.stderr
# Unfortunately the exit code is always 0
return :pass if output.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/go_vet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://godoc.org/code.google.com/p/go-zh.tools/cmd/vet
class GoVet < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

if result.stderr =~ /no such tool "vet"/
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/haml_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class HamlLint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

extract_messages(
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/image_optim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://github.com/toy/image_optim
class ImageOptim < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return [:fail, result.stdout + result.stderr] unless result.success?

optimized_files = extract_optimized_files(result.stdout)
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/java_checkstyle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class JavaCheckstyle < Base
MESSAGE_REGEX = /^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp
return :pass if result.success?

Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/js_hint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see http://jshint.com/
class JsHint < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp

return :pass if result.success? && output.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/js_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class JsLint < Base
MESSAGE_REGEX = /(?<file>(?:\w:)?[^:]+):(?<line>\d+)/

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

# example message:
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/jscs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Overcommit::Hook::PreCommit
# @see http://jscs.info/
class Jscs < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

if result.status == 1
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/pep257.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://pypi.python.org/pypi/pep257
class Pep257 < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

output = result.stderr.chomp
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/pep8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://pypi.python.org/pypi/pep8
class Pep8 < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp

return :pass if result.success? && output.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/puppet_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class PuppetLint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp.gsub(/^"|"$/, '')
return :pass if result.success? && output.empty?

Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/pyflakes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Pyflakes < Base
MESSAGE_REGEX = /^(?<file>(?:\w:)?[^:]+):(?<line>\d+):/

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

errors = get_messages(result.stderr, :error)
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/pylint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Pylint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

output = result.stdout.chomp
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/python_flake8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class PythonFlake8 < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

output = result.stdout.chomp
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/reek.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://github.com/troessner/reek
class Reek < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

output = scrub_output(result.stdout + result.stderr)
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/ruby_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class RubyLint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

extract_messages(
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/scalariform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Scalariform < Base
MESSAGE_REGEX = /^\[(?<type>FAILED|ERROR)\]\s+(?<file>(?:\w:)?.+)/

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)

# example message:
# [FAILED] path/to/file.scala
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/scalastyle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Scalastyle < Base
/x

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp
messages = output.split("\n").grep(MESSAGE_REGEX)
return :pass if result.success? && messages.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/scss_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ScssLint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)

# Status code 81 indicates the applicable files were all filtered by
# exclusions defined by the configuration. In this case, we're happy to
Expand Down
8 changes: 5 additions & 3 deletions lib/overcommit/hook/pre_commit/semi_standard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ module Overcommit::Hook::PreCommit
#
# @see https://github.com/Flet/semistandard
class SemiStandard < Base
MESSAGE_REGEX = /^\s*(?<file>(?:\w:)?[^:]+):(?<line>\d+)/

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp
return :pass if result.success? && output.empty?

# example message:
# path/to/file.js:1:1: Error message (ruleName)
extract_messages(
output.split("\n")[1..-1], # ignore header line
/^\s*(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
output.split("\n").grep(MESSAGE_REGEX), # ignore header line
MESSAGE_REGEX
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/shell_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class ShellCheck < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

extract_messages(
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/slim_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class SlimLint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

extract_messages(
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/sqlint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Sqlint < Base
end

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp
return :pass if result.success? && output.empty?

Expand Down
8 changes: 5 additions & 3 deletions lib/overcommit/hook/pre_commit/standard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ module Overcommit::Hook::PreCommit
#
# @see https://github.com/feross/standard
class Standard < Base
MESSAGE_REGEX = /^\s*(?<file>(?:\w:)?[^:]+):(?<line>\d+)/

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stdout.chomp
return :pass if result.success? && output.empty?

# example message:
# path/to/file.js:1:1: Error message (ruleName)
extract_messages(
output.split("\n")[1..-1], # ignore header line
/^\s*(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
output.split("\n").grep(MESSAGE_REGEX), # ignore header line
MESSAGE_REGEX
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/travis_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://github.com/travis-ci/travis.rb
class TravisLint < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

[:fail, (result.stdout + result.stderr).strip]
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/vint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
# @see https://github.com/Kuniwak/vint
class Vint < Base
def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
return :pass if result.success?

return [:fail, result.stderr] unless result.stderr.empty?
Expand Down
2 changes: 1 addition & 1 deletion lib/overcommit/hook/pre_commit/xml_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class XmlLint < Base
MESSAGE_REGEX = /^(?<file>(?:\w:)?[^:]+):(?<line>\d+):/

def run
result = execute(command + applicable_files)
result = execute(command, args: applicable_files)
output = result.stderr.chomp

return :pass if result.success? && output.empty?
Expand Down