Skip to content

Commit

Permalink
Fix and bump Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
lloeki committed Jan 25, 2023
1 parent dcb3894 commit 4db6396
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
AllCops:
SuggestExtensions: false
NewCops: disable
TargetRubyVersion: 2.0
Exclude:
- src/**/*
- pkg/**/*
- vendor/**/*
- test/**/*

Naming/FileName:
Exclude:
Expand All @@ -26,3 +29,6 @@ Style/WordArray:

Style/PerlBackrefs:
Enabled: false

Gemspec/RequiredRubyVersion:
Enabled: false
8 changes: 2 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ task :compile, [:platform] => [] do |_, args|
local_platform = Gem::Platform.local
target_platform = Gem::Platform.new(ENV['RUBY_TARGET_PLATFORM'] || args.to_h[:platform] || Gem::Platform.local)

if target_platform.os == 'darwin'
target_platform.instance_eval { @version = nil }
end
target_platform.instance_eval { @version = nil } if target_platform.os == 'darwin'

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

if target_platform.os == 'darwin'
target_platform.instance_eval { @version = nil }
end
target_platform.instance_eval { @version = nil } if target_platform.os == 'darwin'

puts "local platform: #{local_platform}"
puts "target platform: #{target_platform}"
Expand Down
2 changes: 1 addition & 1 deletion ext/libv8-node/builder.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unless $LOAD_PATH.include?(File.expand_path('../../lib', __dir__))
unless $LOAD_PATH.include?(File.expand_path('../../lib', __dir__)) # rubocop:disable Style/IfUnlessModifier
$LOAD_PATH.unshift(File.expand_path('../../lib', __dir__))
end
require 'libv8/node/version'
Expand Down
4 changes: 2 additions & 2 deletions ext/libv8-node/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

require 'mkmf'

if RUBY_ENGINE == "truffleruby"
File.write("Makefile", dummy_makefile($srcdir).join(""))
if RUBY_ENGINE == 'truffleruby'
File.write('Makefile', dummy_makefile($srcdir).join('')) # rubocop:disable Style/GlobalVars
return
end

Expand Down
2 changes: 1 addition & 1 deletion ext/libv8-node/location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def configure(context = MkmfContext.new)
def verify_installation!
include_paths = Libv8::Node::Paths.include_paths

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

Expand Down
4 changes: 2 additions & 2 deletions libv8-node.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift File.expand_path('lib', __dir__)
require 'libv8/node/version'

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

s.add_development_dependency 'rake', '~> 12'
s.add_development_dependency 'rubocop', '~> 0.50.0'
s.add_development_dependency 'rubocop', '~> 1.44.0'
end

0 comments on commit 4db6396

Please sign in to comment.