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

Ensure that the code for expect_correction is valid syntax #13237

Merged
merged 1 commit into from
Sep 13, 2024

Conversation

Earlopain
Copy link
Contributor

Issues found with this:

I checked some repos in the rubocop org and they seem to not be affected by this change


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

Issues found with this:
* rubocop#13211
* rubocop#13215
* rubocop#13216
* rubocop#13219
* rubocop#13224
* rubocop#13225

I checked some repos in the rubocop org and they seem to not be affected by this change
@bbatsov
Copy link
Collaborator

bbatsov commented Sep 13, 2024

Hmm, how will this change help in practice? In our tests we obviously have only examples that result in valid syntax. The problem have always been the cases we didn't consider (and test).

@Earlopain
Copy link
Contributor Author

Earlopain commented Sep 13, 2024

In our tests we obviously have only examples that result in valid syntax

That's the plan, sure. But when I added this out of curiosity I found 5 cops that were checking against invalid code in some tests, see the linked PRs.

This doesn't do as much as it could since it only checks one ruby version and behaviour could have changed in subsequent/previous ones, but since it catched some issues this makes sense I think.

@bbatsov bbatsov merged commit 6d708df into rubocop:master Sep 13, 2024
22 checks passed
@bbatsov
Copy link
Collaborator

bbatsov commented Sep 13, 2024

Agreed.

@Earlopain Earlopain deleted the expect-correction-valid-syntax branch September 13, 2024 13:58
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