Skip to content

Add RuboCop - #29

Merged
rikas merged 1 commit into
masterfrom
rubocop
Oct 20, 2026
Merged

rikas merged 1 commit into
masterfrom
rubocop

Conversation

@rikas

@rikas rikas commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Adds RuboCop and fixes everything it flagged. It started at 13 offenses; none were bugs.

Setup

  • rubocop (1.92.0), rubocop-rake and rubocop-rspec in the Gemfile, pinned to patch versions. With NewCops: enable, a new minor RuboCop release could otherwise fail CI with no code change. Bump them on purpose.
  • .rubocop.yml: target Ruby 3.1, new cops enabled.
  • bundle exec rake now runs the specs and RuboCop. CI runs specs on 3.1–4.0 (rake spec) and RuboCop once, in a separate lint job on Ruby 4.0.

Fixes

  • Spec files moved to match the lib layout (RSpec/SpecFilePathFormat): spec/ios/devices_spec.rb, spec/ios/devices/model_spec.rb and spec/ios/devices/device_types_spec.rb. README paths updated.
  • Doc comments for Ios and Ios::Devices.
  • Specs: described_class instead of Ios::Devices; :aggregate_failures on the examples with more than one expectation; the extra vocabulary moved into a let.

Turned off on purpose

  • Gemspec/RequireMFA: releases are published by hand without enforcing MFA.
  • Metrics/ModuleLength and Style/WordArray for lib/ios/devices/device_types.rb only. It's one long data hash, and ['iPad', 'Wi-Fi'] reads better than %w[iPad Wi-Fi].

87 examples pass, there are no RuboCop offenses, and the gem builds cleanly.

🤖 Generated with Claude Code

- rubocop, rubocop-rake and rubocop-rspec, pinned to patch versions so new
  cops don't break CI unexpectedly
- bundle exec rake runs specs and RuboCop; CI runs RuboCop in its own job
- Move specs to match lib paths (spec/ios/devices_spec.rb, spec/ios/devices/)
- Document the Ios and Ios::Devices modules, use described_class and
  aggregate_failures in specs
- Skip the MFA cop (releases are published by hand) and the length and
  word-array cops for the device data file

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rikas
rikas merged commit ceecef0 into master Oct 20, 2026
6 checks passed
@rikas
rikas deleted the rubocop branch October 20, 2026 18:00
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.

1 participant