Skip to content

Enable RuboCop EnforcedShorthandSyntax: always and autocorrect the codebase - #2834

Merged
mroderick merged 1 commit into
masterfrom
rubocop-shorthand-syntax
Aug 31, 2026
Merged

Enable RuboCop EnforcedShorthandSyntax: always and autocorrect the codebase#2834
mroderick merged 1 commit into
masterfrom
rubocop-shorthand-syntax

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Closes #2833

Problem

Style/HashSyntax was enabled with EnforcedShorthandSyntax left at the default either, so both member: member and member: were accepted and which one to write came down to reviewer preference.

Change

  • Set EnforcedShorthandSyntax: always on the existing Style/HashSyntax cop in .rubocop.yml, so hash keywords matching a same-named local variable or method must use Ruby 3.1+ shorthand.
  • Ran bundle exec rubocop -a to autocorrect the existing backlog: 465 offenses across 105 files, all safe corrections (x: xx:). rubocop is now clean.
  • No .rubocop_todo.yml entry needed — the sweep fixes everything, nothing deferred.

@mroderick
mroderick requested a review from olleolleolle August 31, 2026 13:06
@mroderick
mroderick marked this pull request as ready for review August 31, 2026 13:06
@mroderick
mroderick enabled auto-merge August 31, 2026 13:07
@mroderick
mroderick removed the request for review from olleolleolle August 31, 2026 13:07
@mroderick
mroderick disabled auto-merge August 31, 2026 13:14
@mroderick
mroderick merged commit fa5ceae into master Aug 31, 2026
10 checks passed
@mroderick
mroderick deleted the rubocop-shorthand-syntax branch August 31, 2026 13:14
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.

Enable RuboCop EnforcedShorthandSyntax: always and autocorrect the codebase

1 participant