Skip to content

Comments

Add autocorrect support for RSpec/SubjectDeclaration#2161

Merged
bquorning merged 1 commit intorubocop:masterfrom
eugeneius:subject_declaration_autocorrect
Feb 16, 2026
Merged

Add autocorrect support for RSpec/SubjectDeclaration#2161
bquorning merged 1 commit intorubocop:masterfrom
eugeneius:subject_declaration_autocorrect

Conversation

@eugeneius
Copy link
Contributor

This cop's suggestions can be safely autocorrected.


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

@eugeneius eugeneius requested a review from a team as a code owner February 16, 2026 11:22
@bquorning
Copy link
Collaborator

IIRC the resulting code would cause the NamedSubject cop to give offense.

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.

@bquorning let(:subject) { … } -> subject { … } is fine, we only care if several cops would produce opposite or circular corrections.

@bquorning bquorning merged commit 8c2b6b4 into rubocop:master Feb 16, 2026
29 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.

3 participants