summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Kmiec <[email protected]>2023-05-15 23:33:15 -0700
committerPaul Kmiec <[email protected]>2023-05-15 23:37:33 -0700
commit7d70e17cd818958eac09f68c8886b9664aa4ad8c (patch)
tree642cdba3411284481e0e547ce3e496b3c10438c3
parent2b42f259552dd3f443a1393eb8b47e8dc9ee80f2 (diff)
downloadcaxlsx-7d70e17cd818958eac09f68c8886b9664aa4ad8c.tar.gz
caxlsx-7d70e17cd818958eac09f68c8886b9664aa4ad8c.zip
Fix rubocop offenses
We still need Style/OptionalBooleanParameter as Ruby 2.7.5 gets confused with, ``` def serialized_attributes(str = +'', additional_attributes = {}, camelize_value: true) ```
-rw-r--r--.rubocop_todo.yml8
-rw-r--r--lib/axlsx/util/serialized_attributes.rb4
2 files changed, 3 insertions, 9 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 2385ecb2..dde13026 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -79,7 +79,6 @@ Lint/UnusedBlockArgument:
Lint/UnusedMethodArgument:
Exclude:
- 'lib/axlsx/package.rb'
- - 'lib/axlsx/util/serialized_attributes.rb'
- 'lib/axlsx/util/validators.rb'
Lint/UselessAssignment:
@@ -95,11 +94,6 @@ Lint/Void:
- 'lib/axlsx/workbook/worksheet/data_bar.rb'
- 'lib/axlsx/workbook/worksheet/pivot_table.rb'
-# This cop supports safe autocorrection (--autocorrect).
-Performance/BlockGivenWithExplicitBlock:
- Exclude:
- - 'lib/axlsx/util/serialized_attributes.rb'
-
# Configuration parameters: MinSize.
Performance/CollectionLiteralInLoop:
Exclude:
@@ -369,7 +363,6 @@ Style/Next:
Style/NonNilCheck:
Exclude:
- 'lib/axlsx/drawing/d_lbls.rb'
- - 'lib/axlsx/util/serialized_attributes.rb'
- 'lib/axlsx/workbook/worksheet/col.rb'
- 'lib/axlsx/workbook/worksheet/page_setup.rb'
@@ -398,6 +391,7 @@ Style/OptionalBooleanParameter:
Exclude:
- 'lib/axlsx.rb'
- 'lib/axlsx/package.rb'
+ - 'lib/axlsx/util/serialized_attributes.rb'
- 'lib/axlsx/util/validators.rb'
- 'lib/axlsx/workbook/workbook.rb'
- 'lib/axlsx/workbook/worksheet/cell.rb'
diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb
index b2b63fe1..27e19904 100644
--- a/lib/axlsx/util/serialized_attributes.rb
+++ b/lib/axlsx/util/serialized_attributes.rb
@@ -41,7 +41,7 @@ module Axlsx
# creates a XML tag with serialized attributes
# @see SerializedAttributes#serialized_attributes
- def serialized_tag(tagname, str, additional_attributes = {}, &block)
+ def serialized_tag(tagname, str, additional_attributes = {})
str << '<' << tagname << ' '
serialized_attributes(str, additional_attributes)
if block_given?
@@ -96,7 +96,7 @@ module Axlsx
# @param [String] str The string instance to which serialized data is appended
# @param [Array] additional_attributes An array of additional attribute names.
# @return [String] The serialized output.
- def serialized_element_attributes(str = +'', additional_attributes = [], &block)
+ def serialized_element_attributes(str = +'', additional_attributes = [])
attrs = self.class.xml_element_attributes + additional_attributes
values = Axlsx.instance_values_for(self)
attrs.each do |attribute_name|