Skip to content

Fix incorrect plugin version #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

koic
Copy link
Member

@koic koic commented Mar 12, 2025

require_relative 'rubocop/factory_bot/version' was missing, causing the constant lookup for Version::STRING in lib/rubocop/factory_bot/plugin.rb to resolve to RuboCop::Version::STRING instead of RuboCop::FactoryBot::Version::STRING.

This PR fixes an issue where rubocop -V incorrectly displayed the RuboCop version instead of the rubocop-factory_bot version:

$ bundle exec rubocop -V
1.73.2 (using Parser 3.3.7.1, rubocop-ast 1.38.1, analyzing as Ruby 2.7, running on ruby 3.4.2) [x86_64-darwin23]
  - rubocop-performance 1.24.0
  - rubocop-rake 0.7.1
  - rubocop-capybara 1.73.2
  - rubocop-factory_bot 1.73.2
  - rubocop-rspec_rails 2.31.0
  - rubocop-rspec 3.5.0

Replace this text with a summary of the changes in your PR. The more detailed you are, the better.


Before submitting the PR make sure the following are checked:

  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Updated documentation.
  • Added an entry to the CHANGELOG.md if the new code introduces user-observable changes.
  • The build (bundle exec rake) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).

If you have created a new cop:

  • Added the new cop to config/default.yml.
  • The cop is configured as Enabled: pending in config/default.yml.
  • The cop documents examples of good and bad code.
  • The tests assert both that bad code is reported and that good code is not reported.
  • Set VersionAdded: "<<next>>" in default/config.yml.

If you have modified an existing cop's configuration options:

  • Set VersionChanged: "<<next>>" in config/default.yml.

`require_relative 'rubocop/factory_bot/version'` was missing,
causing the constant lookup for `Version::STRING` in `lib/rubocop/factory_bot/plugin.rb` to resolve to
`RuboCop::Version::STRING` instead of `RuboCop::FactoryBot::Version::STRING`.

This PR fixes an issue where `rubocop -V` incorrectly displayed the RuboCop version instead of
the rubocop-factory_bot version:

```console
$ bundle exec rubocop -V
1.73.2 (using Parser 3.3.7.1, rubocop-ast 1.38.1, analyzing as Ruby 2.7, running on ruby 3.4.2) [x86_64-darwin23]
  - rubocop-performance 1.24.0
  - rubocop-rake 0.7.1
  - rubocop-capybara 1.73.2
  - rubocop-factory_bot 1.73.2
  - rubocop-rspec_rails 2.31.0
  - rubocop-rspec 3.5.0
```
@koic koic requested a review from a team as a code owner March 12, 2025 15:58
@bquorning bquorning merged commit 9785649 into rubocop:master Mar 12, 2025
26 checks passed
@bquorning bquorning mentioned this pull request Mar 12, 2025
6 tasks
@koic koic deleted the fix_incorrect_plugin_version branch March 12, 2025 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants