makandra / makandra-rubocop

makandra's default Rubocop configuration
MIT License
6 stars 1 forks source link

Wall of configuration warnings #48

Open kratob opened 1 week ago

kratob commented 1 week ago

After updating to the latest version of makandra-rubocop, I get a wall of warnings:

/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/Capybara/CurrentPathExpectation has the wrong namespace - should be Capybara
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/Capybara/MatchStyle has the wrong namespace - should be Capybara
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/Capybara/NegationMatcher has the wrong namespace - should be Capybara
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/Capybara/SpecificActions has the wrong namespace - should be Capybara
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/Capybara/SpecificFinders has the wrong namespace - should be Capybara
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/Capybara/SpecificMatcher has the wrong namespace - should be Capybara
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/Capybara/VisibilityMatcher has the wrong namespace - should be Capybara
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/FactoryBot/AttributeDefinedStatically has the wrong namespace - should be FactoryBot
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/FactoryBot/ConsistentParenthesesStyle has the wrong namespace - should be FactoryBot
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/FactoryBot/CreateList has the wrong namespace - should be FactoryBot
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/FactoryBot/FactoryClassName has the wrong namespace - should be FactoryBot
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/FactoryBot/FactoryNameStyle has the wrong namespace - should be FactoryBot
/home/tobias/.rbenv/versions/3.3.3/lib/ruby/gems/3.3.0/gems/makandra-rubocop-13.0.0/config/ext/rspec.yml: RSpec/FactoryBot/SyntaxMethods has the wrong namespace - should be FactoryBot

It seems to me I also get all the Capybara and FactoryBot matchers without ever having asked for them, probably simply because the cops are a dependency of makandra-rubocop now.

FLeinzi commented 1 week ago

Seems like this works with rubocop-rspec >3.0 again https://docs.rubocop.org/rubocop-rspec/3.0/upgrade_to_version_3.html

They have extracted Capybara and FactoryBot from rubocop-rspec but left Rspec/Capybara and Rspec/FactoryBot in version < 3.

In another customer project with it's own rubocop fork, I removed the listed cops from rspec.yml within the gem because they are also in capybara.yml or factory_bot.yml.

brunosedler commented 1 week ago

@FLeinzi is rigtht, but we actually did already disable the nested cops like Rspec/Capybara, so I'm a bit confused, why you are even being notified about Cops that are disabled. But we will look into it, and as an upgrade to rubocop-rspec > 3 seems to fix it, that seems to be the most logical approach.

FLeinzi commented 1 week ago

@FLeinzi is rigtht, but we actually did already disable the nested cops like Rspec/Capybara, so I'm a bit confused, why you are even being notified about Cops that are disabled. But we will look into it, and as an upgrade to rubocop-rspec > 3 seems to fix it, that seems to be the most logical approach.

As I said, I just removed them on this customer's fork from the file. I guess that rubocop complains about the definition.

In rubocop-rspec > 3 they removed the dependency on rubocop-capybara and rubocop_factory-bot but they also extracted another gem "rubocop-rspec_rails". I don't know whether I like this approach. In the end we have 1,000 rubocop gems. :sweat_smile: