Skip to content

Commit 8a9ddad

Browse files
josephschorrclaude
andcommitted
fix(ruby): disable Style/TrivialAccessors for spec_helper top-level method
The spec_helper.rb defines `def client; @client; end` at the top level rather than using attr_reader, because attr_reader raises NoMethodError: undefined method 'attr_reader' for main:Object in Ruby 3.2+ when called outside a class/module context. Rubocop now flags the trivial def as Style/TrivialAccessors. Disable the cop so both the runtime constraint and the linter are satisfied. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3eb8dc8 commit 8a9ddad

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

spicedb-ruby/.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,9 @@ Gemspec/DevelopmentDependencies:
6060
# rubygems MFA is for published gems; this is a path-only dev dependency.
6161
Gemspec/RequireMFA:
6262
Enabled: false
63+
64+
# The top-level `def client; @client; end` in examples/spec_helper.rb cannot
65+
# use attr_reader because attr_reader is not available on main:Object in
66+
# Ruby 3.2+ outside a class/module context (raises NoMethodError at load time).
67+
Style/TrivialAccessors:
68+
Enabled: false

0 commit comments

Comments
 (0)