The new Style/MixinGrouping incorrectly registers an offense when rspec's include-expectation is used with multiple elements.
Rubocop does not register an offense.
Rubocop registers an offense.
Create the following file, e.g. as mixin_grouping_spec.rb:
require 'rspec'
describe 'rubocop Style/MixinGrouping' do
it 'should not register an offense for rspec-include' do
expect([1, 2, 3]).to include(1, 2)
end
end
Call rubocop mixin_grouping_spec.rb:
$ rubocop mixin_grouping_spec.rb
Inspecting 1 file
C
Offenses:
mixin_grouping_spec.rb:5:26: C: Put include mixins in separate statements.
expect([1, 2, 3]).to include(1, 2)
^^^^^^^^^^^^^
1 file inspected, 1 offense detected
$ rubocop -V
0.48.0 (using Parser 2.4.0.0, running on ruby 2.4.0 x86_64-darwin16)
Another false positive:
config.include Mongoid::Matchers, type: :model
Hi, I think the something is happening for extend
lib/client_side_validations/active_record.rb:8:1: C: Style/MixinGrouping: Put extend mixins in separate statements.
ClientSideValidations::Extender.extend 'ActiveRecord', %w(Uniqueness)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@tagliala: It is fixed for all methods on master, but it is has not gone into any release yet. 馃檪
@Drenmi thanks for answering.
I'm pretty confident I'm using master branch
Using rubocop 0.48.0 from git://github.com/bbatsov/rubocop.git (at master@e50e7ad)
$ bundle exec rubocop -d
For ~/dev/client_side_validations: configuration from ~/dev/client_side_validations/.rubocop.yml
Default configuration from ~/.rvm/gems/ruby-2.4.1/bundler/gems/rubocop-e50e7ad6356b/config/default.yml
Inheriting configuration from ~/.rvm/gems/ruby-2.4.1/bundler/gems/rubocop-e50e7ad6356b/config/enabled.yml
Inheriting configuration from ~/.rvm/gems/ruby-2.4.1/bundler/gems/rubocop-e50e7ad6356b/config/disabled.yml
[...]
Offenses:
lib/client_side_validations/active_record.rb:8:1: W: Lint/UnneededDisable: Unnecessary disabling of Style/MixinGrouping.
# rubocop:disable Style/MixinGrouping
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
edit: Please ignore me, it's fixed 馃憤 :)
Most helpful comment
Another false positive: