From f70c0d4c92f16eece847004ee3488dc15d23db98 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Thu, 4 May 2023 17:34:00 +0200 Subject: Fix Layout/HeredocIndentation offenses Also use `XML` as delimiter to highlight syntax in supported editors --- .rubocop_todo.yml | 6 ------ lib/axlsx/drawing/vml_drawing.rb | 26 +++++++++++++------------- lib/axlsx/drawing/vml_shape.rb | 40 ++++++++++++++++++++-------------------- 3 files changed, 33 insertions(+), 39 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0ec0a44a..fbe7cb50 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -22,12 +22,6 @@ Layout/HashAlignment: - 'lib/axlsx/workbook/worksheet/border_creator.rb' - 'test/tc_axlsx.rb' -# This cop supports safe autocorrection (--autocorrect). -Layout/HeredocIndentation: - Exclude: - - 'lib/axlsx/drawing/vml_drawing.rb' - - 'lib/axlsx/drawing/vml_shape.rb' - # This cop supports safe autocorrection (--autocorrect). Lint/AmbiguousOperatorPrecedence: Exclude: diff --git a/lib/axlsx/drawing/vml_drawing.rb b/lib/axlsx/drawing/vml_drawing.rb index 4e9c5b0d..63c42457 100644 --- a/lib/axlsx/drawing/vml_drawing.rb +++ b/lib/axlsx/drawing/vml_drawing.rb @@ -19,19 +19,19 @@ module Axlsx # @param [String] str # @return [String] def to_xml_string(str = '') - str << < - - - - - - - -BAD_PROGRAMMER + str << <<~XML + + + + + + + + + XML @comments.each { |comment| comment.vml_shape.to_xml_string str } str << "" end diff --git a/lib/axlsx/drawing/vml_shape.rb b/lib/axlsx/drawing/vml_shape.rb index fd335d95..7f196974 100644 --- a/lib/axlsx/drawing/vml_shape.rb +++ b/lib/axlsx/drawing/vml_shape.rb @@ -36,28 +36,28 @@ module Axlsx # @param [String] str # @return [String] def to_xml_string(str = '') - str << < - - - - -
-
+ + + + + +
+
- - - - #{left_column}, #{left_offset}, #{top_row}, #{top_offset}, #{right_column}, #{right_offset}, #{bottom_row}, #{bottom_offset} - False - #{row} - #{column} - #{@visible ? '' : ''} - -
-SHAME_ON_YOU + + + + #{left_column}, #{left_offset}, #{top_row}, #{top_offset}, #{right_column}, #{right_offset}, #{bottom_row}, #{bottom_offset} + False + #{row} + #{column} + #{@visible ? '' : ''} + + + XML end end end -- cgit v1.2.3