rubocop / rubocop-rspec

Code style checking for RSpec files.
https://docs.rubocop.org/rubocop-rspec
MIT License
805 stars 277 forks source link

Backport of support `AutoCorrect: contextual` option for LSP #1905

Closed ydah closed 3 months ago

ydah commented 3 months ago

Backport of https://github.com/rubocop/rubocop-rspec/pull/1899


Before submitting the PR make sure the following are checked:

ydah commented 3 months ago

Yes. I have verified that autocorrect will just keep working as works when the following environment is used.

❯ bundle exec rubocop -V                     
1.60.0 (using Parser 3.3.1.0, rubocop-ast 1.31.3, running on ruby 3.3.0) [arm64-darwin23]
  - rubocop-performance 1.21.0
  - rubocop-rake 0.6.0
  - rubocop-rspec 2.30.0
❯ git diff
Δ config/default.yml
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

─────────────────┐
• 147: RSpec/Be: │
─────────────────┘
 147⋮ 147│RSpec/BeEmpty:
 148⋮ 148│  Description: Prefer using `be_empty` when checking for an empty array.
 149⋮ 149│  Enabled: pending
    ⋮ 150│  AutoCorrect: contextual
 150⋮ 151│  VersionAdded: '2.20'
    ⋮ 152│  VersionChanged: "<<next>>"
 151⋮ 153│  Reference: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/BeEmpty
 152⋮ 154│
 153⋮ 155│RSpec/BeEq: