Use RuboCop's own Style/OpenStructUse cop

What does this MR do?

Removes our Style/OpenStructUse cop, so RuboCop's built-in cop with the same name takes over. rubocop-style.yml still enables it, which is needed because upstream's default is pending.

Closes #25 (closed)

Why it's safe
  • RuboCop has shipped Style/OpenStructUse since 1.23.0 (https://github.com/rubocop/rubocop/pull/10217). Because both cops have the same name, ours has replaced the upstream one ever since.
  • The logic is the same. The only differences are the message and a nil check on the parent node that only upstream has.
  • The cop name, config keys and rubocop:disable Style/OpenStructUse comments keep working. On this branch, a file using OpenStruct still gets an offense, now with upstream's message.

Impact: the offense message changes to upstream's: "Avoid using OpenStruct; use Struct, Hash, a class or test doubles instead." Nothing needs to change in projects using gitlab-styles.

Merge request reports

Loading
Loading