Seems rubocop trying to analyze Gemfile and .bundle dir by default and if there is no such file\dir - there is failure
I understand that is not common behavior for ruby script to not to have Gemfile, but I dont think this failure is looking good
mkdir /tmp/rubocop-bugcd /tmp/rubocop-bugtouch test.rbrubocop test.rbResult is:
rubocop test.rb
Inspecting 1 file
W
Offenses:
test.rb:1:1: W: Lint/EmptyFile: Empty file detected.
1 file inspected, 1 offense detected
Could not locate Gemfile or .bundle/ directory
/usr/share/rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/bundler.rb:281:in `rescue in root'
/usr/share/rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/bundler.rb:277:in `root'
/usr/share/rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/bundler.rb:178:in `load'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli/command/suggest_extensions.rb:57:in `dependent_gems'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli/command/suggest_extensions.rb:52:in `block in extensions'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli/command/suggest_extensions.rb:52:in `select'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli/command/suggest_extensions.rb:52:in `extensions'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli/command/suggest_extensions.rb:15:in `run'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli/command.rb:11:in `run'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli/environment.rb:18:in `run'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli.rb:65:in `run_command'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli.rb:77:in `suggest_extensions'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli.rb:72:in `block in execute_runners'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli.rb:72:in `tap'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli.rb:72:in `execute_runners'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/lib/rubocop/cli.rb:41:in `run'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/exe/rubocop:13:in `block in <top (required)>'
/usr/share/rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/benchmark.rb:308:in `realtime'
/home/lobashov/.rvm/gems/ruby-2.7.2/gems/rubocop-1.5.0/exe/rubocop:12:in `<top (required)>'
/home/lobashov/.rvm/gems/ruby-2.7.2/bin/rubocop:23:in `load'
/home/lobashov/.rvm/gems/ruby-2.7.2/bin/rubocop:23:in `<main>'
/home/lobashov/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:24:in `eval'
/home/lobashov/.rvm/gems/ruby-2.7.2/bin/ruby_executable_hooks:24:in `<main>'
$ [bundle exec] rubocop -V
1.5.0 (using Parser 2.7.2.0, rubocop-ast 1.3.0, running on ruby 2.7.2 x86_64-linux)
@dvandersluis Guess you know what to do. :-)
On it.
@bbatsov this is a duplicate of #9145.
@dvandersluis I think it's better to change name of #9145, I searched before posting this bug, but JRuby in #9145 title make me ignore it
@ShockwaveNN I agree, but don't have access to change it 馃槄. In any case #9149 will fix both!
RuboCop 1.5.1 is out https://github.com/rubocop-hq/rubocop/releases/tag/v1.5.1