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

Consider testing against YARP's fixtures #12085

Closed
andyw8 opened this issue Jul 31, 2023 · 2 comments · Fixed by #12086
Closed

Consider testing against YARP's fixtures #12085

andyw8 opened this issue Jul 31, 2023 · 2 comments · Fixed by #12086
Labels

Comments

@andyw8
Copy link
Contributor

andyw8 commented Jul 31, 2023

Is your feature request related to a problem? Please describe.

Writing cops which work against all possible Ruby syntax variations can be difficult. In particulary, newly added a cops often need fixes once they are enabled on real world codebases.

Describe the solution you'd like

The YARP project contains a large collection of fixtures which may be useful to test against:

https://github.com/ruby/yarp/tree/main/test/fixtures

Running it against the latest RuboCop shows one failure currently:

An error occurred while Lint/SuppressedException cop was inspecting /Users/andyw8/src/github.com/Shopify/yarp/test/fixtures/rescue.rb:26:34.

The YARP fixtures could be added as a submodule.

Describe alternatives you've considered

n/a

Additional context

I initially thought this may have prevented #12079 but there's no fixture in YARP for that currently. I still believe it could be useful to test against though.

koic added a commit to koic/rubocop that referenced this issue Jul 31, 2023
Fixes rubocop#12085.

This PR fixes an error for `Lint/SuppressedException`
when `AllowNil: true` is set and endless method definition is used.
@koic
Copy link
Member

koic commented Jul 31, 2023

That's an interesting idea, but its implementation needs to be considered. In the meantime, I opened #12086 to prevent the Lint/SuppressedException's error.

@koic koic added the bug label Jul 31, 2023
koic added a commit that referenced this issue Aug 1, 2023
…eption

[Fix #12085] Fix an error for `Lint/SuppressedException`
@andyw8
Copy link
Contributor Author

andyw8 commented Aug 1, 2023

@koic Since #12086 only fixes the example mentioned in the description rather than addressing the idea itself, should this be kept open?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants