Skip to content
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

Backport of support AutoCorrect: contextual option for LSP #1905

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

ydah
Copy link
Member

@ydah ydah commented Jun 5, 2024

Backport of #1899


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

@ydah ydah requested a review from a team as a code owner June 5, 2024 13:56
Copy link
Collaborator

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

As mentioned in #1901 (comment) I think if people are using an older version of RuboCop than v1.61, autocorrect will just keep working as it always has (and if they are using v1.61+ then get the new LSP feature too).

Have you verified that this is actually the case?

@ydah
Copy link
Member Author

ydah commented Jun 5, 2024

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:

@ydah ydah merged commit 2b69a04 into 2-x-stable Jun 5, 2024
24 checks passed
@ydah ydah deleted the backport branch June 5, 2024 16:28
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