Skip to content

Conversation

ydah
Copy link
Member

@ydah ydah commented Oct 2, 2025

This is because in some cases, even when a safety tag is present, safe may be false or set_autocorrect may be true.

  • # @safety
    # The autocorrect is experimental - use with care! It can be configured
    # with CustomTransform (e.g. have => has) and IgnoredWords (e.g. only).
    #
    # While the autocorrect will not break your code (it only modifies test
    # description strings, not the actual test logic), it may produce
    # grammatically incorrect English in some cases. Always review the diff
    # when using autocorrect to ensure the descriptions remain natural and
    # accurate.
    #
    # This is not classified as an unsafe autocorrect because it does not
    # affect code behavior, but manual review of changes is strongly
    # recommended.

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

…` YARD tag

This is because in some cases, even when a safety tag is present, `safe` may be `false` or `set_autocorrect` may be `true`.
- https://github.com/rubocop/rubocop-rspec/blob/e63ee9a79c17be296d41ac36dc006d94d6d12069/lib/rubocop/cop/rspec/example_wording.rb#L13-L25
@ydah ydah requested a review from a team as a code owner October 2, 2025 14:28
@pirj
Copy link
Member

pirj commented Oct 4, 2025

No objections on merging as is. Though, isn’t this a helpful poka-yoke? Maybe we could exclude some cops by marking them as “@safety tentative” in their docs and filtering those from participating in this spec?

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.

Thank you!

@ydah ydah merged commit 7e6691d into master Oct 5, 2025
27 checks passed
@ydah ydah deleted the flaky branch October 5, 2025 02:24
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