brew style false positive

Created on 14 Oct 2019  路  3Comments  路  Source: Homebrew/brew

  • [x] are reporting a bug others will be able to reproduce and not asking a question. If you're not sure or want to ask a question do so on our Discourse: https://discourse.brew.sh
  • [x] ran a brew command and reproduced the problem with multiple formulae? If it's a problem with a single, official formula (not cask) please file this issue at Homebrew/homebrew-core: https://github.com/Homebrew/homebrew-core/issues/new/choose. If it's a brew cask problem please file this issue at https://github.com/Homebrew/homebrew-cask/issues/new/choose. If it's a tap (e.g. Homebrew/homebrew-php) problem please file this issue at the tap.
  • [x] ran brew update and can still reproduce the problem?
  • [x] ran brew doctor, fixed all issues and can still reproduce the problem?
  • [x] ran brew config and brew doctor and included their output with your issue?

Bug description

$ brew style mysql
== mysql.rb ==
C:158:  5: Redundant begin block detected.

1 file inspected, 1 offense detected

which I believe is a false positive:

  test do
    begin
      [鈥
    ensure
      Process.kill(9, pid)
      Process.wait(pid)
    end
  end

Configuration

$ brew config
HOMEBREW_VERSION: 2.1.14-23-g8fa65aa
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8fa65aaabf3f38fe502ef83eac86e4e8000d5b22
Last commit: 3 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: b929e6eeaad17639333c46561681f262cd8ca495
Core tap last commit: 5 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_BINTRAY_KEY: set
HOMEBREW_BINTRAY_USER: fxcoudert
HOMEBREW_DEV_CMD_RUN: 1
HOMEBREW_NO_ANALYTICS_THIS_RUN: 1
CPU: dodeca-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1100
Git: 2.21.0 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 13
macOS: 10.15-x86_64
CLT: 11.0.0.0.1.1567737322
Xcode: 11.1
CLT headers: 11.0.0.0.1.1567737322
XQuartz: 2.7.11 => /opt/X11
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Some installed formulae are missing dependencies.
You should `brew install` the missing dependencies:
  brew install openssl

Run `brew missing` for more details.
outdated

Most helpful comment

Agreed, not a false positive. What I should have mentioned in https://github.com/Homebrew/brew/pull/6592 was that we typically autocorrect Homebrew/homebrew-core on similar Rubocop changes. I've done that now and pushed to master (and fixed a few manual issues there too).

All 3 comments

This will most likely be due to #6592 and the fact that Rubocop's now set to lint based on Ruby 2.6 syntax. There were some autocorrections in that PR for this exact linting error that made it successfully through mine and @reitermarkus's very keen eyes.

Maybe there's another bug in Rubocop? Should we disable this lint globally in rubocop.yml and revert the previous autocorrections?

In this case it isn't a false positive though. It should be

  test do
    [鈥
  ensure
    Process.kill(9, pid)
    Process.wait(pid)
  end

now.

Agreed, not a false positive. What I should have mentioned in https://github.com/Homebrew/brew/pull/6592 was that we typically autocorrect Homebrew/homebrew-core on similar Rubocop changes. I've done that now and pushed to master (and fixed a few manual issues there too).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdekok picture cdekok  路  4Comments

kirk86 picture kirk86  路  3Comments

JustinTArthur picture JustinTArthur  路  3Comments

mislav picture mislav  路  3Comments

stejmurphy picture stejmurphy  路  4Comments