diff --git a/.rubocop.yml b/.rubocop.yml index a6c7ace..da625c1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,3 +15,6 @@ Style/DocumentDynamicEvalDefinition: Style/MultipleComparison: Enabled: false + +Style/NumericPredicate: + EnforcedStyle: comparison diff --git a/benchmarks/benchmarks.rb b/benchmarks/benchmarks.rb index 0880948..e789533 100644 --- a/benchmarks/benchmarks.rb +++ b/benchmarks/benchmarks.rb @@ -291,7 +291,7 @@ def positional_splat_keyword_and_double_splat_args(a, *args, b:, **kwargs) benchmark_json.sort_by! { |json| json["name"] } # Print headers based on the first benchmark_json - if i.zero? + if i == 0 benchmark_headers = benchmark_json.map do |benchmark_gem| # Gem name is of the form: # "memoist (1.1.0): ()" diff --git a/lib/memo_wise/internal_api.rb b/lib/memo_wise/internal_api.rb index 3a80a8b..aa613c4 100644 --- a/lib/memo_wise/internal_api.rb +++ b/lib/memo_wise/internal_api.rb @@ -44,7 +44,7 @@ def self.create_memo_wise_state!(obj) # - :double_splat (examples: `def foo(a: 1)`, `def foo(a:, **b)`) # - :splat_and_double_splat (examples: `def foo(a=1, b: 2)`, `def foo(a=1, **b)`, `def foo(*a, **b)`) def self.method_arguments(method) - return NONE if method.arity.zero? + return NONE if method.arity == 0 parameters = method.parameters.map(&:first)