ExpandPathArguments上的rubocop错误



我有这个rubocop错误

Offenses:
fastlane-plugin-lizard.gemspec:1:12: C: Style/ExpandPathArguments: Use expand_path('lib', __dir__) instead of expand_path('../lib', __FILE__).
lib = File.expand_path("../lib", __FILE__)
           ^^^^^^^^^^^
10 files inspected, 1 offense detected
RuboCop failed!
Exited with code 1

如何修复此错误? cos 遵循 rubocop 建议 我会得到另一个错误

#!/bin/bash -eo pipefail
bundle check || bundle install --jobs=4 --retry=3 --path vendor/bundle
[!] There was an error parsing `Gemfile`: 
[!] There was an error while loading `fastlane-plugin-lizard.gemspec`: cannot load such file -- fastlane/plugin/lizard/version
Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.

更改

lib = File.expand_path("../lib", __FILE__)

lib = File.expand_path("lib", __dir__)

相关内容

  • 没有找到相关文章

最新更新