rubocop: 1.6.0 breaks Rubocop run

I have the GH actions set as follow:

name: Rubocop

on:
  pull_request:
    branches:
      - 'master'

jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 5

    steps:
    - uses: actions/checkout@v2

    - name: "Checkout master (base is needed to detect changed files)"
      run: git fetch origin master:master --no-tags --quiet --depth 1

    - uses: ruby/setup-ruby@v1

    - name: "Rubocop: install"
      run: gem install -N rubocop rubocop-performance rubocop-rails

    - name: "Rubocop: run"
      run: git diff --diff-filter=ACM --name-only master | xargs rubocop --format s

This now fails with:

--------Error: `Performance` cops have been extracted to the `rubocop-performance` gem.
(obsolete configuration found in .rubocop.yml, please update it)
`Rails` cops have been extracted to the `rubocop-rails` gem.
(obsolete configuration found in .rubocop.yml, please update it)

This is also strange (run locally):

rubocop -v
1.6.0
rubocop -V
Error: `Performance` cops have been extracted to the `rubocop-performance` gem.
(obsolete configuration found in .rubocop.yml, please update it)
`Rails` cops have been extracted to the `rubocop-rails` gem.
(obsolete configuration found in .rubocop.yml, please update it)
bundle exec rubocop -V
1.6.0 (using Parser 2.7.2.0, rubocop-ast 1.3.0, running on ruby 2.7.2 x86_64-linux)
  - rubocop-performance 1.9.1
  - rubocop-rails 2.9.0

So locally it runs fine with bundle exec rubocop but simple rubocop does not work

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 18 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Looking into it!

Hmm, seems we messed up, but I’m sure we’ll manage to sort this out quickly. Seems our warnings didn’t factor in the possibility that someone might be using extensions directly without a Gemfile. Sorry about the inconvenience! //cc @dvandersluis

I’ve merged the fix and I’ll cut a new release tomorrow, so I can give you the opportunity to test it by building the gem from master. Huge thanks to @dvandersluis for instantly jumping on this and fixing it! 🏆 🥇

@key88sf can you lock your build to 1.5.2 until this is resolved? I imagine @bbatsov will release 1.6.1 pretty quickly once this is fixed.

require:
  - rubocop-performance
  - rubocop-rails

AllCops:
  TargetRubyVersion: 2.7
  DisabledByDefault: true
  NewCops: enable
  # Git submodules
  Exclude:
    - docs/**/*

Performance:
  Enabled: true
Security:
  Enabled: true

# TODO
Performance/CollectionLiteralInLoop:
  Enabled: false

# Lint
Lint/AmbiguousOperator:
  Enabled: true
  Exclude:
    - test/**/*.rb
...
...

As described, it fails when run without a bundler.

I’m experiencing this. My require looks like:

  - rubocop-rspec
  - rubocop-performance
  - rubocop-rails

Here is a gist of my entire .rubocop.yml