Skip to content

Draft: Add RSpec Cop that flags shorthand hash matcher

Matthias Käppler requested to merge mk-rspec-kwargs-cop into master

What does this MR do and why?

This is supposed to flag test that use the shorthand hash syntax with Rspec with argument matchers. This leads to test failures in Ruby 3 like the following: #366942 (closed)

Doesn't work yet, because the AST is the same when processed by RuboCop (uses the parser gem internally)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Matthias Käppler

Merge request reports