Skip to content

Comments

RSpec/ContextWording: Detect non-string in Prefixes#2059

Merged
ydah merged 1 commit intorubocop:masterfrom
sakuro:context-wording/check-prefix-types
Mar 19, 2025
Merged

RSpec/ContextWording: Detect non-string in Prefixes#2059
ydah merged 1 commit intorubocop:masterfrom
sakuro:context-wording/check-prefix-types

Conversation

@bquorning
Copy link
Collaborator

@bquorning bquorning commented Mar 10, 2025

Fixes #2051


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).

Copy link
Collaborator Author

@bquorning bquorning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add e.g. this to the changelog:

- Fix issue when `Style/ContextWording` is configured with a Prefix being interpreted as a boolean, like `on`. ([@sakuro])

and add [@sakuro]: https://github.com/sakuro towards the bottom of the file.

@bquorning
Copy link
Collaborator Author

cc @sakuro

@sakuro sakuro force-pushed the context-wording/check-prefix-types branch from 6da303f to 4b4f0ea Compare March 11, 2025 01:22
@sakuro
Copy link
Contributor

sakuro commented Mar 17, 2025

@bquorning hi, I think you can mark this as ready for review.

@bquorning bquorning marked this pull request as ready for review March 17, 2025 17:02
@bquorning bquorning requested a review from a team as a code owner March 17, 2025 17:02
@bquorning
Copy link
Collaborator Author

cc @pirj, @ydah

@bquorning
Copy link
Collaborator Author

@sakuro could you rebase, and squash the commits please?

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprising YAML
Thank you!

@sakuro sakuro force-pushed the context-wording/check-prefix-types branch 2 times, most recently from f321e29 to c3345f4 Compare March 18, 2025 00:29
@sakuro
Copy link
Contributor

sakuro commented Mar 18, 2025

@bquorning rebased and squashed

@ydah
Copy link
Member

ydah commented Mar 18, 2025

Could you please fixes rubocop offenses?

Offenses:

spec/rubocop/cop/rspec/context_wording_spec.rb:241:81: C: [Correctable] Layout/LineLength: Line is too long. [94/80]
      expect { expect_no_offenses(<<~RUBY) }.to raise_error(/Non-string prefixes .+ detected/)
                                                                                ^^^^^^^^^^^^^^

278 files inspected, 1 offense detected, 1 offense autocorrectable

Co-authored-by: Benjamin Quorning <22333+bquorning@users.noreply.github.com>
Co-authored-by: Phil Pirozhkov <pirj@users.noreply.github.com>
@sakuro sakuro force-pushed the context-wording/check-prefix-types branch from d659b40 to 1a7c2e1 Compare March 19, 2025 02:03
@sakuro
Copy link
Contributor

sakuro commented Mar 19, 2025

Could you please fixes rubocop offenses?

Fixed and squashed

Copy link
Member

@ydah ydah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ydah ydah merged commit da49c6f into rubocop:master Mar 19, 2025
27 checks passed
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.

Want helpful message when Prefixes of ContextWording contains non-string.

4 participants