Skip to content

Use explicit hash value syntax instead of shorthand#1285

Merged
SugatD merged 2 commits into
mainfrom
fix/explicit-hash-syntax
May 19, 2026
Merged

Use explicit hash value syntax instead of shorthand#1285
SugatD merged 2 commits into
mainfrom
fix/explicit-hash-syntax

Conversation

@SugatD
Copy link
Copy Markdown

@SugatD SugatD commented May 18, 2026

Summary

  • Replace Ruby 3.1+ shorthand hash syntax ({ key: }) with the explicit form ({ key: key }) in 4 files (3 spec files + the apt_key provider).
  • Relax Style/HashSyntax via EnforcedShorthandSyntax: either in .rubocop.yml so both forms are accepted by RuboCop.

Files changed

  • .rubocop.yml — new Style/HashSyntax block with EnforcedShorthandSyntax: either.
  • lib/puppet/provider/apt_key/apt_key.rbexpired:,expired: expired,.
  • spec/classes/apt_backports_spec.rb — 4× codename:,codename: codename,.
  • spec/defines/source_spec.rbid:)id: id), id:,id: id,.
  • spec/defines/ppa_spec.rbenvironment:,environment: environment,.

Test plan

  • bundle exec rubocop — 45 files inspected, no offenses detected.
  • pdk validate — exit 0.
  • CI passes on the PR.

🤖 Generated with Claude Code

Replace Ruby 3.1+ shorthand hash syntax (`{ key: }`) with the explicit
form (`{ key: key }`) across spec files and the apt_key provider, and
relax the RuboCop `Style/HashSyntax` rule via `EnforcedShorthandSyntax:
either` so both forms are accepted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SugatD SugatD requested review from a team, bastelfreak and smortex as code owners May 18, 2026 10:29
Comment thread .rubocop.yml Outdated
Per review feedback, fully disable `Style/HashSyntax` instead of
allowing `EnforcedShorthandSyntax: either`, which could let shorthand
creep back in and cause inconsistency.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@SugatD SugatD merged commit 09b9f37 into main May 19, 2026
14 checks passed
@SugatD SugatD deleted the fix/explicit-hash-syntax branch May 19, 2026 05:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants