Skip to content

Commit

Permalink
Merge pull request #47 from viralpraxis/enable-new-rubocop-cops
Browse files Browse the repository at this point in the history
Enable new rubocop cops
  • Loading branch information
viralpraxis authored Sep 14, 2024
2 parents f8c7990 + 4456c17 commit fddd9c2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require:
AllCops:
DisplayCopNames: true
TargetRubyVersion: 2.7
NewCops: enable

Lint/RaiseException:
Enabled: true
Expand Down Expand Up @@ -80,3 +81,9 @@ Style/SymbolArray:

RSpec/ExampleLength:
Max: 11

Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec

Gemspec/RequireMFA:
Enabled: false
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,19 @@ def in_def_class_methods_module?(node)

ancestor.def_type?
end
return unless defn
return false unless defn

mod = defn.ancestors.find do |ancestor|
%i[class module].include?(ancestor.type)
end
return unless mod
return false unless mod

class_methods_module?(mod)
end

def in_def_module_function?(node)
defn = node.ancestors.find(&:def_type?)
return unless defn
return false unless defn

defn.left_siblings.any? { |sibling| module_function_bare_access_modifier?(sibling) } ||
defn.right_siblings.any? { |sibling| module_function_for?(sibling, defn.method_name) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def container?(node)
end

def mutable_literal?(node)
return if node.nil?
return false if node.nil?

node.mutable_literal? || range_type?(node)
end
Expand Down
2 changes: 1 addition & 1 deletion rubocop-thread_safety.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Gem::Specification.new do |spec|

spec.required_ruby_version = '>= 2.7.0'

spec.add_runtime_dependency 'rubocop', '>= 0.92.0'
spec.add_dependency 'rubocop', '>= 0.92.0'

spec.add_development_dependency 'appraisal'
spec.add_development_dependency 'bundler', '>= 1.10', '< 3'
Expand Down

0 comments on commit fddd9c2

Please sign in to comment.