Skip to content

Commit

Permalink
rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzak committed Jul 1, 2024
1 parent d3bb0ac commit c3ce222
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ Layout/EndAlignment:
EnforcedStyleAlignWith: variable
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
Gemspec/DevelopmentDependencies:
Enabled: false
2 changes: 1 addition & 1 deletion lib/nazar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module Nazar # rubocop:disable Metrics/ModuleLength

setting :enable_shorthand_method, default: true

class << self
class << self # rubocop:disable Metrics/ClassLength
def formatters
@formatters ||= Set.new
end
Expand Down
2 changes: 1 addition & 1 deletion lib/nazar/formatter/generic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def summary
end

def self.valid?(data)
return unless data.is_a?(Enumerable)
return false unless data.is_a?(Enumerable)

item = data&.first
item.respond_to?(:keys) && item.respond_to?(:values)
Expand Down
3 changes: 1 addition & 2 deletions lib/nazar/formatter/struct.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
module Nazar
module Formatter
class Struct

def initialize(item)
@collection = Array(item)
@attributes = item.to_h.keys
Expand All @@ -24,7 +23,7 @@ def headers

def cells
@cells ||= @collection.map do |item|
item.each_pair do |column, value|
item.each_pair do |_, value|
CellFormatter.new(value, type: nil).format
end
end
Expand Down
1 change: 0 additions & 1 deletion spec/nazar/view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
context 'with Struct' do
let(:data) { Struct.new(:id, :name).new(1, 'foo') }


context 'without loaded extension' do
it do
expect(subject).not_to be_supported_data
Expand Down
4 changes: 2 additions & 2 deletions spec/nazar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

context 'when Pry is defined' do
it do
::Pry = double
::Pry = double # rubocop:disable Style/RedundantConstantBase

expect(Nazar).to receive(:enable_for_pry!)
expect(Nazar).not_to receive(:enable_for_irb!)
Expand All @@ -26,7 +26,7 @@

context 'when IRB is defined' do
it do
::IRB = double
::IRB = double # rubocop:disable Style/RedundantConstantBase

expect(Nazar).not_to receive(:enable_for_pry!)
expect(Nazar).to receive(:enable_for_irb!)
Expand Down

0 comments on commit c3ce222

Please sign in to comment.