puppetlabs / puppet-lint

Check that your Puppet manifests conform to the style guide
https://puppetlabs.github.io/puppet-lint/
MIT License
18 stars 12 forks source link

(maint) Exclude breaking rubocop versions #203

Closed gavindidrichsen closed 3 weeks ago

gavindidrichsen commented 3 weeks ago

The latest versions of rubocop-factory_bot and rubocop-respec_rails are causing rubocop-rspec to break with something like the following:

➜  dependency_checker git:(main) bundle exec rubocop
Error: Property AutoCorrect of cop FactoryBot/CreateList is supposed to be a boolean and contextual is not.
➜  dependency_checker git:(main) 

Manually correcting the above gems fixes the issue with:

➜  gems git:(main) ✗ git diff
diff --git a/rubocop-factory_bot-2.26.0/config/default.yml b/rubocop-factory_bot-2.26.0/config/default.yml
index 24d5ebb..60827e7 100644
--- a/rubocop-factory_bot-2.26.0/config/default.yml
+++ b/rubocop-factory_bot-2.26.0/config/default.yml
@@ -49,7 +49,7 @@ FactoryBot/ConsistentParenthesesStyle:
 FactoryBot/CreateList:
   Description: Checks for create_list usage.
   Enabled: true
-  AutoCorrect: contextual
+  AutoCorrect: false
   Include:
     - "**/*_spec.rb"
     - "**/spec/**/*"
diff --git a/rubocop-rspec_rails-2.29.0/config/default.yml b/rubocop-rspec_rails-2.29.0/config/default.yml
index 51ec888..a39bd20 100644
--- a/rubocop-rspec_rails-2.29.0/config/default.yml
+++ b/rubocop-rspec_rails-2.29.0/config/default.yml
@@ -66,7 +66,7 @@ RSpecRails/MinitestAssertions:

 RSpecRails/NegationBeValid:
   Description: Enforces use of `be_invalid` or `not_to` for negated be_valid.
-  AutoCorrect: contextual
+  AutoCorrect: false
   Safe: false
   EnforcedStyle: not_to
   SupportedStyles:
➜  gems git:(main) ✗ pwd
/Users/gavin.didrichsen/@REFERENCES/github/app/development/tools/puppet/@products/devx_tools/repos/dependency_checker/.direnv/ruby/gems/ruby/3.3.0/gems
➜  gems git:(main) ✗ 

Therefore excluding the latest version until this is fixed.

codecov[bot] commented 3 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 93.19%. Comparing base (72f0e05) to head (9384bb5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #203 +/- ## ======================================= Coverage 93.19% 93.19% ======================================= Files 55 55 Lines 1792 1792 ======================================= Hits 1670 1670 Misses 122 122 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

gavindidrichsen commented 3 weeks ago

Raised bug https://github.com/rubocop/rubocop-rspec/issues/1916

bastelfreak commented 3 weeks ago

@gavindidrichsen why are the gems added? puppet-lint isn't a rails project. And I think it also doesn't use factory_bot?

gavindidrichsen commented 3 weeks ago

@gavindidrichsen why are the gems added? puppet-lint isn't a rails project. And I think it also doesn't use factory_bot?

Hi @bastelfreak. The rubocop-rspec is pulling in these dependencies had breaking changes and they were causing the pipelines to fail.

    rubocop-rspec (2.30.0)
      rubocop (~> 1.40)
      rubocop-capybara (~> 2.17)
      rubocop-factory_bot (~> 2.22)
      rubocop-rspec_rails (~> 2.28)
ekohl commented 3 weeks ago

Interesting, because I didn't expect that. It's also misleading that in 3.x they're dropped, so https://rubygems.org/gems/rubocop-rspec doesn't show them initially. Only when you go to an older version.