Skip to content

Commit 9636eb3

Browse files
committed
Upgrade RuboCop 0.39.0 -> 0.40.0 for Travis
1 parent 4464d08 commit 9636eb3

File tree

5 files changed

+25
-18
lines changed

5 files changed

+25
-18
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ gem 'travis', '~> 1.7'
1212
gem 'coveralls'
1313

1414
# Pin RuboCop for Travis builds.
15-
gem 'rubocop', '0.39.0'
15+
gem 'rubocop', '0.40.0'

lib/overcommit/utils.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ def processor_count # rubocop:disable all
220220
if Overcommit::OS.windows?
221221
require 'win32ole'
222222
result = WIN32OLE.connect('winmgmts://').ExecQuery(
223-
'select NumberOfLogicalProcessors from Win32_Processor')
223+
'select NumberOfLogicalProcessors from Win32_Processor'
224+
)
224225
result.to_enum.collect(&:NumberOfLogicalProcessors).reduce(:+)
225226
elsif File.readable?('/proc/cpuinfo')
226227
IO.read('/proc/cpuinfo').scan(/^processor/).size
@@ -284,9 +285,10 @@ def convert_glob_to_absolute(glob)
284285
# @param pattern [String]
285286
# @param path [String]
286287
def matches_path?(pattern, path)
287-
File.fnmatch?(pattern, path,
288-
File::FNM_PATHNAME | # Wildcard doesn't match separator
289-
File::FNM_DOTMATCH # Wildcards match dotfiles
288+
File.fnmatch?(
289+
pattern, path,
290+
File::FNM_PATHNAME | # Wildcard doesn't match separator
291+
File::FNM_DOTMATCH # Wildcards match dotfiles
290292
)
291293
end
292294

spec/overcommit/hook/pre_commit/forbidden_branches_spec.rb

+8-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
let(:default_config) { Overcommit::ConfigurationLoader.default_configuration }
55
let(:branch_patterns) { ['master', 'release/*'] }
66
let(:config) do
7-
default_config.merge(Overcommit::Configuration.new(
8-
'PreCommit' => {
9-
'ForbiddenBranches' => {
10-
'branch_patterns' => branch_patterns
7+
default_config.merge(
8+
Overcommit::Configuration.new(
9+
'PreCommit' => {
10+
'ForbiddenBranches' => {
11+
'branch_patterns' => branch_patterns
12+
}
1113
}
12-
}))
14+
)
15+
)
1316
end
1417
let(:context) { double('context') }
1518
subject { described_class.new(config, context) }

spec/overcommit/hook/pre_commit/go_lint_spec.rb

+6-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
context 'and it reports an error' do
2828
context 'on stdout' do
2929
before do
30-
result.stub(stderr: '', stdout:
31-
'file1.go:1:1: error should be the last type when returning multiple items'
30+
result.stub(
31+
stderr: '',
32+
stdout: 'file1.go:1:1: error should be the last type when returning multiple items',
3233
)
3334
end
3435

@@ -37,8 +38,9 @@
3738

3839
context 'on stderr' do
3940
before do
40-
result.stub(stdout: '', stderr:
41-
"file1.go:1:1: expected 'package', found 'IDENT' foo"
41+
result.stub(
42+
stdout: '',
43+
stderr: "file1.go:1:1: expected 'package', found 'IDENT' foo"
4244
)
4345
end
4446

spec/overcommit/hook/pre_commit/go_vet_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929

3030
context 'when go tool vet is not installed' do
3131
before do
32-
result.stub(stderr:
33-
'go tool: no such tool "vet"; to install:'
32+
result.stub(
33+
stderr: 'go tool: no such tool "vet"; to install:',
3434
)
3535
end
3636

@@ -39,8 +39,8 @@
3939

4040
context 'and it reports an error' do
4141
before do
42-
result.stub(stderr:
43-
'file1.go:1: possible formatting directive in Print call'
42+
result.stub(
43+
stderr: 'file1.go:1: possible formatting directive in Print call',
4444
)
4545
end
4646

0 commit comments

Comments
 (0)