Skip to content

Commit

Permalink
RuboCop Auto Correct: Layout/IndentHeredoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ericboehs authored and jasonrclark committed Nov 7, 2017
1 parent e1ce965 commit 7e705ec
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 158 deletions.
21 changes: 1 addition & 20 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-10-14 13:54:13 -0500 using RuboCop version 0.50.0.
# on 2017-10-14 13:56:46 -0500 using RuboCop version 0.50.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -20,25 +20,6 @@ Layout/EmptyLinesAroundExceptionHandlingKeywords:
Exclude:
- 'shoes-swt/lib/shoes/swt/sound.rb'

# Offense count: 20
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: auto_detection, squiggly, active_support, powerpack, unindent
Layout/IndentHeredoc:
Exclude:
- 'samples/good_vjot.rb'
- 'samples/simple_accordion.rb'
- 'samples/simple_lorem_ipsum.rb'
- 'shoes-core/lib/shoes/color.rb'
- 'shoes-core/lib/shoes/dsl/art.rb'
- 'shoes-core/lib/shoes/dsl/media.rb'
- 'shoes-core/lib/shoes/ui/cli/help_command.rb'
- 'shoes-core/lib/shoes/ui/cli/manual_command.rb'
- 'shoes-core/lib/shoes/ui/cli/select_backend_command.rb'
- 'shoes-core/lib/shoes/ui/cli/version_command.rb'
- 'shoes-swt/lib/shoes/swt/app.rb'
- 'shoes-swt/lib/shoes/swt/generate_backend.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
Expand Down
22 changes: 11 additions & 11 deletions samples/good_vjot.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# frozen_string_literal: true

NOTES = [['Welcome to the vJot Clone', <<-'END']].freeze
This sample app is a notetaker, a clone of PJ Hyett's vjot.com.
NOTES = [['Welcome to the vJot Clone', <<~'END']].freeze
This sample app is a notetaker, a clone of PJ Hyett's vjot.com.
Creating
----------
Click "Add a New Note" and the jot will be loaded into the editor for reading or editing.
Creating
----------
Click "Add a New Note" and the jot will be loaded into the editor for reading or editing.
Editing
---------
Click a jot's title to load it.
Editing
---------
Click a jot's title to load it.
Saving
--------
There is no save button, the jot is saved as you edit.
Saving
--------
There is no save button, the jot is saved as you edit.
END

Expand Down
54 changes: 27 additions & 27 deletions samples/simple_accordion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,37 +63,37 @@ def page(title, active, text)
style(Shoes::Link, stroke: black, underline: nil, weight: "strong")
style(Shoes::LinkHover, stroke: black, fill: nil, underline: nil)

page "0.0", true, <<-'END'
There is a thought
I have just had
Which I don’t care to pass to
Anyone at all at this time.
page "0.0", true, <<~'END'
There is a thought
I have just had
Which I don’t care to pass to
Anyone at all at this time.
I have even forgotten it now,
But kept only the pleasures
Of my property
And of my controlled mental slippage.
I have even forgotten it now,
But kept only the pleasures
Of my property
And of my controlled mental slippage.
END
page "0.1", false, <<-'END'
My eyes have blinked again
And I have just realized
This upright world
I have been in.
page "0.1", false, <<~'END'
My eyes have blinked again
And I have just realized
This upright world
I have been in.
My eyelids wipe
My eyes hundreds of times
Reseting and renovating
The scenery.
My eyelids wipe
My eyes hundreds of times
Reseting and renovating
The scenery.
END
page "0.2", false, <<-'END'
Sister, without you,
The universe would
Have such a hole through it,
Where infinity has been shot.
page "0.2", false, <<~'END'
Sister, without you,
The universe would
Have such a hole through it,
Where infinity has been shot.
This cannot be, though.
There will always be room
For you—all of us are
Holding the way open.
This cannot be, though.
There will always be room
For you—all of us are
Holding the way open.
END
end
16 changes: 8 additions & 8 deletions samples/simple_lorem_ipsum.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# frozen_string_literal: true

TEXT = <<EOS
Lorem ipsum dolor sit amet, consectetur adipisicing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris \
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in \
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in \
culpa qui officia deserunt mollit anim id est laborum.
TEXT = <<~EOS
Lorem ipsum dolor sit amet, consectetur adipisicing elit, \
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris \
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in \
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in \
culpa qui officia deserunt mollit anim id est laborum.
EOS

NL = "\n\n"
Expand Down
12 changes: 6 additions & 6 deletions shoes-core/lib/shoes/color.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ def initialize(*args) # red, green, blue, alpha = OPAQUE)
when 3, 4
red, green, blue, alpha = *args
else
message = <<EOS
Wrong number of arguments (#{args.length} for 1, 3, or 4).
Must be one of:
- #{self.class}.new(hex_string)
- #{self.class}.new(red, green, blue)
- #{self.class}.new(red, green, blue, alpha)
message = <<~EOS
Wrong number of arguments (#{args.length} for 1, 3, or 4).
Must be one of:
- #{self.class}.new(hex_string)
- #{self.class}.new(red, green, blue)
- #{self.class}.new(red, green, blue, alpha)
EOS
raise ArgumentError, message
end
Expand Down
100 changes: 50 additions & 50 deletions shoes-core/lib/shoes/dsl/art.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def arrow(*args, &blk)

left, top, width, *leftovers = args

message = <<EOS
Too many arguments. Must be one of:
- arrow(left, top, width, [opts])
- arrow(left, top, [opts])
- arrow(left, [opts])
- arrow([opts])
message = <<~EOS
Too many arguments. Must be one of:
- arrow(left, top, width, [opts])
- arrow(left, top, [opts])
- arrow(left, [opts])
- arrow([opts])
EOS
raise ArgumentError, message if leftovers.any?

Expand All @@ -52,15 +52,15 @@ def arc(*args, &blk)

left, top, width, height, angle1, angle2, *leftovers = args

message = <<EOS
Too many arguments. Must be one of:
- arc(left, top, width, height, angle1, angle2, [opts])
- arc(left, top, width, height, angle1, [opts])
- arc(left, top, width, height, [opts])
- arc(left, top, width, [opts])
- arc(left, top, [opts])
- arc(left, [opts])
- arc([opts])
message = <<~EOS
Too many arguments. Must be one of:
- arc(left, top, width, height, angle1, angle2, [opts])
- arc(left, top, width, height, angle1, [opts])
- arc(left, top, width, height, [opts])
- arc(left, top, width, [opts])
- arc(left, top, [opts])
- arc(left, [opts])
- arc([opts])
EOS
raise ArgumentError, message if leftovers.any?

Expand All @@ -79,13 +79,13 @@ def line(*args, &blk)

x1, y1, x2, y2, *leftovers = args

message = <<EOS
Too many arguments. Must be one of:
- line(x1, y1, x2, y2, [opts])
- line(x1, y1, x2, [opts])
- line(x1, y1, [opts])
- line(x1, [opts])
- line([opts])
message = <<~EOS
Too many arguments. Must be one of:
- line(x1, y1, x2, y2, [opts])
- line(x1, y1, x2, [opts])
- line(x1, y1, [opts])
- line(x1, [opts])
- line([opts])
EOS
raise ArgumentError, message if leftovers.any?

Expand Down Expand Up @@ -119,13 +119,13 @@ def oval(*args, &blk)

left, top, width, height, *leftovers = args

message = <<EOS
Wrong number of arguments. Must be one of:
- oval(left, top, width, height, [opts])
- oval(left, top, diameter, [opts])
- oval(left, top, [opts])
- oval(left, [opts])
- oval(styles)
message = <<~EOS
Wrong number of arguments. Must be one of:
- oval(left, top, width, height, [opts])
- oval(left, top, diameter, [opts])
- oval(left, top, [opts])
- oval(left, [opts])
- oval(styles)
EOS
raise ArgumentError, message if leftovers.any?

Expand Down Expand Up @@ -160,14 +160,14 @@ def rect(*args, &blk)
left, top, width, height, curve, *leftovers = args
opts[:curve] = curve if curve

message = <<EOS
Wrong number of arguments. Must be one of:
- rect(left, top, width, height, curve, [opts])
- rect(left, top, width, height, [opts])
- rect(left, top, side, [opts])
- rect(left, top, [opts])
- rect(left, [opts])
- rect(styles)
message = <<~EOS
Wrong number of arguments. Must be one of:
- rect(left, top, width, height, curve, [opts])
- rect(left, top, width, height, [opts])
- rect(left, top, side, [opts])
- rect(left, top, [opts])
- rect(left, [opts])
- rect(styles)
EOS

raise ArgumentError, message if leftovers.any?
Expand Down Expand Up @@ -208,14 +208,14 @@ def star(*args, &blk)

left, top, points, outer, inner, *leftovers = args

message = <<EOS
Wrong number of arguments. Must be one of:
- star([styles])
- star(left, [styles])
- star(left, top, [styles])
- star(left, top, points, [styles])
- star(left, top, points, outer, [styles])
- star(left, top, points, outer, inner, [styles])
message = <<~EOS
Wrong number of arguments. Must be one of:
- star([styles])
- star(left, [styles])
- star(left, top, [styles])
- star(left, top, points, [styles])
- star(left, top, points, outer, [styles])
- star(left, top, points, outer, inner, [styles])
EOS
raise ArgumentError, message if leftovers.any?

Expand All @@ -241,11 +241,11 @@ def shape(*args, &blk)

left, top, *leftovers = args

message = <<EOS
Wrong number of arguments. Must be one of:
- shape(left, top, [opts])
- shape(left, [opts])
- shape([opts])
message = <<~EOS
Wrong number of arguments. Must be one of:
- shape(left, top, [opts])
- shape(left, [opts])
- shape([opts])
EOS

raise ArgumentError, message if leftovers.any?
Expand Down
6 changes: 3 additions & 3 deletions shoes-core/lib/shoes/dsl/media.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ def image(*args, &blk)
opts = style_normalizer.normalize pop_style(args)
path, *leftovers = args

message = <<EOS
Wrong number of arguments. Must be:
- image(path, [opts])
message = <<~EOS
Wrong number of arguments. Must be:
- image(path, [opts])
EOS
raise ArgumentError, message if leftovers.any?

Expand Down
6 changes: 3 additions & 3 deletions shoes-core/lib/shoes/ui/cli/help_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def run
end

def help
<<-EOS
shoes help
Displays this help text
<<~EOS
shoes help
Displays this help text
EOS
end
end
Expand Down
6 changes: 3 additions & 3 deletions shoes-core/lib/shoes/ui/cli/manual_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ def run
end

def help
<<-EOS
shoes manual
Run the interactive Shoes manual
<<~EOS
shoes manual
Run the interactive Shoes manual
EOS
end
end
Expand Down
8 changes: 4 additions & 4 deletions shoes-core/lib/shoes/ui/cli/select_backend_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def run
end

def help
<<-EOS
shoes select_backend [backend]
Select a Shoes backend to use. A backend can be specified, or Shoes will
attempt to auto-detect available backends to select from.
<<~EOS
shoes select_backend [backend]
Select a Shoes backend to use. A backend can be specified, or Shoes will
attempt to auto-detect available backends to select from.
EOS
end
end
Expand Down
6 changes: 3 additions & 3 deletions shoes-core/lib/shoes/ui/cli/version_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ def run
end

def help
<<-EOS
shoes version
Prints the current Shoes version
<<~EOS
shoes version
Prints the current Shoes version
EOS
end
end
Expand Down
Loading

0 comments on commit 7e705ec

Please sign in to comment.