Skip to content

Commit 4db6396

Browse files
committed
Fix and bump Rubocop
1 parent dcb3894 commit 4db6396

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

.rubocop.yml

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
AllCops:
2+
SuggestExtensions: false
3+
NewCops: disable
24
TargetRubyVersion: 2.0
35
Exclude:
46
- src/**/*
57
- pkg/**/*
68
- vendor/**/*
9+
- test/**/*
710

811
Naming/FileName:
912
Exclude:
@@ -26,3 +29,6 @@ Style/WordArray:
2629

2730
Style/PerlBackrefs:
2831
Enabled: false
32+
33+
Gemspec/RequiredRubyVersion:
34+
Enabled: false

Rakefile

+2-6
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@ task :compile, [:platform] => [] do |_, args|
2323
local_platform = Gem::Platform.local
2424
target_platform = Gem::Platform.new(ENV['RUBY_TARGET_PLATFORM'] || args.to_h[:platform] || Gem::Platform.local)
2525

26-
if target_platform.os == 'darwin'
27-
target_platform.instance_eval { @version = nil }
28-
end
26+
target_platform.instance_eval { @version = nil } if target_platform.os == 'darwin'
2927

3028
puts "local platform: #{local_platform}"
3129
puts "target platform: #{target_platform}"
@@ -46,9 +44,7 @@ task :binary, [:platform] => [:compile] do |_, args|
4644
local_platform = Gem::Platform.local.dup
4745
target_platform = Gem::Platform.new(ENV['RUBY_TARGET_PLATFORM'] || args.to_h[:platform] || Gem::Platform.local)
4846

49-
if target_platform.os == 'darwin'
50-
target_platform.instance_eval { @version = nil }
51-
end
47+
target_platform.instance_eval { @version = nil } if target_platform.os == 'darwin'
5248

5349
puts "local platform: #{local_platform}"
5450
puts "target platform: #{target_platform}"

ext/libv8-node/builder.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unless $LOAD_PATH.include?(File.expand_path('../../lib', __dir__))
1+
unless $LOAD_PATH.include?(File.expand_path('../../lib', __dir__)) # rubocop:disable Style/IfUnlessModifier
22
$LOAD_PATH.unshift(File.expand_path('../../lib', __dir__))
33
end
44
require 'libv8/node/version'

ext/libv8-node/extconf.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
require 'mkmf'
44

5-
if RUBY_ENGINE == "truffleruby"
6-
File.write("Makefile", dummy_makefile($srcdir).join(""))
5+
if RUBY_ENGINE == 'truffleruby'
6+
File.write('Makefile', dummy_makefile($srcdir).join('')) # rubocop:disable Style/GlobalVars
77
return
88
end
99

ext/libv8-node/location.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def configure(context = MkmfContext.new)
4545
def verify_installation!
4646
include_paths = Libv8::Node::Paths.include_paths
4747

48-
unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? }
48+
unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? } # rubocop:disable Style/IfUnlessModifier
4949
raise(HeaderNotFound, "Unable to locate 'v8.h' in the libv8 header paths: #{include_paths.inspect}")
5050
end
5151

libv8-node.gemspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
1+
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
22
require 'libv8/node/version'
33

44
Gem::Specification.new do |s|
@@ -23,5 +23,5 @@ Gem::Specification.new do |s|
2323
s.require_paths = ['lib', 'ext']
2424

2525
s.add_development_dependency 'rake', '~> 12'
26-
s.add_development_dependency 'rubocop', '~> 0.50.0'
26+
s.add_development_dependency 'rubocop', '~> 1.44.0'
2727
end

0 commit comments

Comments
 (0)