Skip to content

Commit 627a8c0

Browse files
jawshooahsds
authored andcommitted
Match leading drive specifier in message regexes
1 parent d34279a commit 627a8c0

33 files changed

+33
-33
lines changed

lib/overcommit/hook/pre_commit/css_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
44
# @see https://github.com/CSSLint/csslint
55
class CssLint < Base
66
MESSAGE_REGEX = /
7-
^(?<file>[^:]+):\s
7+
^(?<file>(?:\w:)?[^:]+):\s
88
(?:line\s(?<line>\d+)[^EW]+)?
99
(?<type>Error|Warning)
1010
/x

lib/overcommit/hook/pre_commit/es_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def run
1212
# path/to/file.js: line 1, col 0, Error - Error message (ruleName)
1313
extract_messages(
1414
output.split("\n").grep(/Warning|Error/),
15-
/^(?<file>[^:]+):[^\d]+(?<line>\d+).*?(?<type>Error|Warning)/,
15+
/^(?<file>(?:\w:)?[^:]+):[^\d]+(?<line>\d+).*?(?<type>Error|Warning)/,
1616
lambda { |type| type.downcase.to_sym }
1717
)
1818
end

lib/overcommit/hook/pre_commit/go_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313
# path/to/file.go:1:1: Error message
1414
extract_messages(
1515
output.split("\n"),
16-
/^(?<file>[^:]+):(?<line>\d+)/
16+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
1717
)
1818
end
1919
end

lib/overcommit/hook/pre_commit/go_vet.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def run
1515
# path/to/file.go:7: Error message
1616
extract_messages(
1717
result.stderr.split("\n"),
18-
/^(?<file>[^:]+):(?<line>\d+)/
18+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
1919
)
2020
end
2121
end

lib/overcommit/hook/pre_commit/haml_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313

1414
extract_messages(
1515
result.stdout.split("\n"),
16-
/^(?<file>[^:]+):(?<line>\d+)[^ ]* (?<type>[^ ]+)/,
16+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)[^ ]* (?<type>[^ ]+)/,
1717
MESSAGE_TYPE_CATEGORIZER,
1818
)
1919
end

lib/overcommit/hook/pre_commit/hard_tabs.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def run
66

77
extract_messages(
88
result.stdout.split("\n"),
9-
/^(?<file>[^:]+):(?<line>\d+)/,
9+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/,
1010
)
1111
end
1212
end

lib/overcommit/hook/pre_commit/html_hint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313
file = lines[0][/(.+):/, 1]
1414
extract_messages(
1515
lines[1..-1].map { |msg| "#{file}: #{msg}" },
16-
/^(?<file>[^:]+): line (?<line>\d+)/
16+
/^(?<file>(?:\w:)?[^:]+): line (?<line>\d+)/
1717
)
1818
end.flatten
1919
end

lib/overcommit/hook/pre_commit/html_tidy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Overcommit::Hook::PreCommit
44
# @see http://www.html-tidy.org/
55
class HtmlTidy < Base
66
MESSAGE_REGEX = /
7-
^(?<file>[^:]+):\s
7+
^(?<file>(?:\w:)?[^:]+):\s
88
line\s(?<line>\d+)\s
99
column\s(?<col>\d+)\s-\s
1010
(?<type>Error|Warning):\s(?<message>.+)$

lib/overcommit/hook/pre_commit/java_checkstyle.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see http://checkstyle.sourceforge.net/
55
class JavaCheckstyle < Base
6-
MESSAGE_REGEX = /^(?<file>[^:]+):(?<line>\d+)/
6+
MESSAGE_REGEX = /^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
77

88
def run
99
result = execute(command + applicable_files)

lib/overcommit/hook/pre_commit/js_hint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313
# path/to/file.js: line 1, col 0, Error message (E001)
1414
extract_messages(
1515
output.split("\n").grep(/E|W/),
16-
/^(?<file>[^:]+):[^\d]+(?<line>\d+).+\((?<type>E|W)\d+\)/,
16+
/^(?<file>(?:\w:)?[^:]+):[^\d]+(?<line>\d+).+\((?<type>E|W)\d+\)/,
1717
lambda { |type| type.include?('W') ? :warning : :error }
1818
)
1919
end

lib/overcommit/hook/pre_commit/js_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see http://www.jslint.com/
55
class JsLint < Base
6-
MESSAGE_REGEX = /(?<file>[^:]+):(?<line>\d+)/
6+
MESSAGE_REGEX = /(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
77

88
def run
99
result = execute(command + applicable_files)

lib/overcommit/hook/pre_commit/jscs.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def run
1717
# path/to/file.js: line 7, col 0, ruleName: Error message
1818
extract_messages(
1919
result.stdout.split("\n"),
20-
/^(?<file>[^:]+):[^\d]+(?<line>\d+)/,
20+
/^(?<file>(?:\w:)?[^:]+):[^\d]+(?<line>\d+)/,
2121
)
2222
end
2323
end

lib/overcommit/hook/pre_commit/jsl.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see http://www.javascriptlint.com/
55
class Jsl < Base
6-
MESSAGE_REGEX = /(?<file>.+)\((?<line>\d+)\):(?<type>[^:]+)/
6+
MESSAGE_REGEX = /(?<file>(?:\w:)?.+)\((?<line>\d+)\):(?<type>[^:]+)/
77

88
MESSAGE_TYPE_CATEGORIZER = lambda do |type|
99
type =~ /warning/ ? :warning : :error

lib/overcommit/hook/pre_commit/pep257.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def run
1414
# D102: Docstring missing
1515
extract_messages(
1616
output.gsub(/:\s+/, ': ').split("\n"),
17-
/^(?<file>[^:]+):(?<line>\d+)/
17+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
1818
)
1919
end
2020
end

lib/overcommit/hook/pre_commit/pep8.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313
# path/to/file.py:88:5: E301 expected 1 blank line, found 0
1414
extract_messages(
1515
output.split("\n"),
16-
/^(?<file>[^:]+):(?<line>\d+):\d+:\s(?<type>E|W)/,
16+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+):\d+:\s(?<type>E|W)/,
1717
lambda { |type| type.include?('W') ? :warning : :error }
1818
)
1919
end

lib/overcommit/hook/pre_commit/puppet_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see http://puppet-lint.com/
55
class PuppetLint < Base
6-
MESSAGE_REGEX = /(?<file>.+):(?<line>\d+):\d+:(?<type>\w+)/
6+
MESSAGE_REGEX = /(?<file>(?:\w:)?.+):(?<line>\d+):\d+:(?<type>\w+)/
77

88
MESSAGE_TYPE_CATEGORIZER = lambda do |type|
99
type == 'ERROR' ? :error : :warning

lib/overcommit/hook/pre_commit/pyflakes.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see https://pypi.python.org/pypi/pyflakes
55
class Pyflakes < Base
6-
MESSAGE_REGEX = /^(?<file>[^:]+):(?<line>\d+):/
6+
MESSAGE_REGEX = /^(?<file>(?:\w:)?[^:]+):(?<line>\d+):/
77

88
def run
99
result = execute(command + applicable_files)

lib/overcommit/hook/pre_commit/pylint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see http://www.pylint.org/
55
class Pylint < Base
6-
MESSAGE_REGEX = /^(?<file>.+):(?<line>\d+):(?<type>[CEFRW])/
6+
MESSAGE_REGEX = /^(?<file>(?:\w:)?.+):(?<line>\d+):(?<type>[CEFRW])/
77

88
# Classify 'E' and 'F' message codes as errors,
99
# everything else as warnings.

lib/overcommit/hook/pre_commit/python_flake8.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see https://pypi.python.org/pypi/flake8
55
class PythonFlake8 < Base
6-
MESSAGE_REGEX = /^(?<file>.+):(?<line>\d+):\d+:\s(?<type>\w\d+)/
6+
MESSAGE_REGEX = /^(?<file>(?:\w:)?.+):(?<line>\d+):\d+:\s(?<type>\w\d+)/
77

88
# Classify 'Exxx' and 'Fxxx' message codes as errors,
99
# everything else as warnings.

lib/overcommit/hook/pre_commit/reek.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def run
1111

1212
extract_messages(
1313
output,
14-
/^\s*(?<file>[^:]+):(?<line>\d+):/,
14+
/^\s*(?<file>(?:\w:)?[^:]+):(?<line>\d+):/,
1515
)
1616
end
1717

lib/overcommit/hook/pre_commit/rubo_cop.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313

1414
extract_messages(
1515
result.stdout.split("\n"),
16-
/^(?<file>[^:]+):(?<line>\d+):[^ ]+ (?<type>[^ ]+)/,
16+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+):[^ ]+ (?<type>[^ ]+)/,
1717
MESSAGE_TYPE_CATEGORIZER,
1818
)
1919
end

lib/overcommit/hook/pre_commit/ruby_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313

1414
extract_messages(
1515
result.stdout.split("\n"),
16-
/^(?<file>[^:]+):(?<type>[^:]+):(?<line>\d+)/,
16+
/^(?<file>(?:\w:)?[^:]+):(?<type>[^:]+):(?<line>\d+)/,
1717
MESSAGE_TYPE_CATEGORIZER
1818
)
1919
end

lib/overcommit/hook/pre_commit/scalariform.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see https://github.com/mdr/scalariform
55
class Scalariform < Base
6-
MESSAGE_REGEX = /^\[(?<type>FAILED|ERROR)\]\s+(?<file>.+)/
6+
MESSAGE_REGEX = /^\[(?<type>FAILED|ERROR)\]\s+(?<file>(?:\w:)?.+)/
77

88
def run
99
result = execute(command + applicable_files)

lib/overcommit/hook/pre_commit/scalastyle.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Overcommit::Hook::PreCommit
55
class Scalastyle < Base
66
MESSAGE_REGEX = /
77
^(?<type>error|warning)\s
8-
file=(?<file>.+)\s
8+
file=(?<file>(?:\w:)?.+)\s
99
message=.+\s
1010
line=(?<line>\d+)
1111
/x

lib/overcommit/hook/pre_commit/scss_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def run
2020

2121
extract_messages(
2222
result.stdout.split("\n"),
23-
/^(?<file>[^:]+):(?<line>\d+)[^ ]* (?<type>[^ ]+)/,
23+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)[^ ]* (?<type>[^ ]+)/,
2424
MESSAGE_TYPE_CATEGORIZER,
2525
)
2626
end

lib/overcommit/hook/pre_commit/semi_standard.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def run
1212
# path/to/file.js:1:1: Error message (ruleName)
1313
extract_messages(
1414
output.split("\n")[1..-1], # ignore header line
15-
/^\s*(?<file>[^:]+):(?<line>\d+)/
15+
/^\s*(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
1616
)
1717
end
1818
end

lib/overcommit/hook/pre_commit/shell_check.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313

1414
extract_messages(
1515
result.stdout.split("\n"),
16-
/^(?<file>[^:]+):(?<line>\d+):[^ ]+ (?<type>[^ ]+)/,
16+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+):[^ ]+ (?<type>[^ ]+)/,
1717
MESSAGE_TYPE_CATEGORIZER,
1818
)
1919
end

lib/overcommit/hook/pre_commit/slim_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313

1414
extract_messages(
1515
result.stdout.split("\n"),
16-
/^(?<file>[^:]+):(?<line>\d+)[^ ]* (?<type>[^ ]+)/,
16+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)[^ ]* (?<type>[^ ]+)/,
1717
MESSAGE_TYPE_CATEGORIZER,
1818
)
1919
end

lib/overcommit/hook/pre_commit/sqlint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see https://github.com/purcell/sqlint
55
class Sqlint < Base
6-
MESSAGE_REGEX = /(?<file>.+):(?<line>\d+):\d+:(?<type>\w+)/
6+
MESSAGE_REGEX = /(?<file>(?:\w:)?.+):(?<line>\d+):\d+:(?<type>\w+)/
77

88
MESSAGE_TYPE_CATEGORIZER = lambda do |type|
99
type == 'ERROR' ? :error : :warning

lib/overcommit/hook/pre_commit/standard.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def run
1212
# path/to/file.js:1:1: Error message (ruleName)
1313
extract_messages(
1414
output.split("\n")[1..-1], # ignore header line
15-
/^\s*(?<file>[^:]+):(?<line>\d+)/
15+
/^\s*(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
1616
)
1717
end
1818
end

lib/overcommit/hook/pre_commit/trailing_whitespace.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def run
66

77
extract_messages(
88
result.stdout.split("\n"),
9-
/^(?<file>[^:]+):(?<line>\d+)/,
9+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/,
1010
)
1111
end
1212
end

lib/overcommit/hook/pre_commit/vint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def run
1313
# path/to/file.vim:1:1: Error message
1414
extract_messages(
1515
result.stdout.split("\n"),
16-
/^(?<file>[^:]+):(?<line>\d+)/
16+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/
1717
)
1818
end
1919
end

lib/overcommit/hook/pre_commit/xml_lint.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module Overcommit::Hook::PreCommit
33
#
44
# @see http://xmlsoft.org/xmllint.html
55
class XmlLint < Base
6-
MESSAGE_REGEX = /^(?<file>[^:]+):(?<line>\d+):/
6+
MESSAGE_REGEX = /^(?<file>(?:\w:)?[^:]+):(?<line>\d+):/
77

88
def run
99
result = execute(command + applicable_files)

0 commit comments

Comments
 (0)