summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-04-08 11:45:31 +0200
committerGeremia Taglialatela <[email protected]>2023-04-08 11:45:31 +0200
commitacf00d356494ef504c3de0e4a0db6b25f2bd7636 (patch)
tree32ae11cf4900864abc034ec9265bf7b4a38fb258
parent5d68145521afe5c5912ceebae2f7e784eb5f8954 (diff)
downloadcaxlsx-acf00d356494ef504c3de0e4a0db6b25f2bd7636.tar.gz
caxlsx-acf00d356494ef504c3de0e4a0db6b25f2bd7636.zip
Fix offenses related to trailing commas
-rw-r--r--.rubocop_todo.yml19
-rw-r--r--lib/axlsx/workbook/worksheet/border_creator.rb2
-rw-r--r--test/stylesheet/tc_styles.rb2
-rw-r--r--test/workbook/worksheet/tc_date_time_converter.rb8
-rw-r--r--test/workbook/worksheet/tc_pivot_table.rb4
-rw-r--r--test/workbook/worksheet/tc_worksheet.rb2
6 files changed, 9 insertions, 28 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index 7dc60f46..86b99a38 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1163,25 +1163,6 @@ Style/TernaryParentheses:
- 'lib/axlsx/drawing/scatter_series.rb'
- 'lib/axlsx/workbook/worksheet/rich_text_run.rb'
-# Offense count: 3
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: EnforcedStyleForMultiline.
-# SupportedStylesForMultiline: comma, consistent_comma, no_comma
-Style/TrailingCommaInArrayLiteral:
- Exclude:
- - 'test/stylesheet/tc_styles.rb'
- - 'test/workbook/worksheet/tc_pivot_table.rb'
-
-# Offense count: 6
-# This cop supports safe autocorrection (--autocorrect).
-# Configuration parameters: EnforcedStyleForMultiline.
-# SupportedStylesForMultiline: comma, consistent_comma, no_comma
-Style/TrailingCommaInHashLiteral:
- Exclude:
- - 'lib/axlsx/workbook/worksheet/border_creator.rb'
- - 'test/workbook/worksheet/tc_date_time_converter.rb'
- - 'test/workbook/worksheet/tc_worksheet.rb'
-
# Offense count: 11
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods.
diff --git a/lib/axlsx/workbook/worksheet/border_creator.rb b/lib/axlsx/workbook/worksheet/border_creator.rb
index b949a76e..2dcbdf0f 100644
--- a/lib/axlsx/workbook/worksheet/border_creator.rb
+++ b/lib/axlsx/workbook/worksheet/border_creator.rb
@@ -48,7 +48,7 @@ module Axlsx
top: "#{first_cell}:#{last_col}#{first_row}",
right: "#{last_col}#{first_row}:#{last_cell}",
bottom: "#{first_col}#{last_row}:#{last_cell}",
- left: "#{first_cell}:#{first_col}#{last_row}",
+ left: "#{first_cell}:#{first_col}#{last_row}"
}
end
diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb
index 627acbe3..8bb6ff32 100644
--- a/test/stylesheet/tc_styles.rb
+++ b/test/stylesheet/tc_styles.rb
@@ -37,7 +37,7 @@ class TestStyles < Test::Unit::TestCase
{:edges => [:bottom], :style => :thick, :color => "FF0000"},
{:edges => [:left], :style => :dotted, :color => "FFFF00"},
{:edges => [:right], :style => :dashed, :color => "FFFFFF"},
- {:style => :thick, :color => "CCCCCC"},
+ {:style => :thick, :color => "CCCCCC"}
]
@styles.add_style(border: borders_array)
diff --git a/test/workbook/worksheet/tc_date_time_converter.rb b/test/workbook/worksheet/tc_date_time_converter.rb
index fafd66c6..393a9d1a 100644
--- a/test/workbook/worksheet/tc_date_time_converter.rb
+++ b/test/workbook/worksheet/tc_date_time_converter.rb
@@ -27,7 +27,7 @@ class TestDateTimeConverter < Test::Unit::TestCase
"1970-01-01" => 25569.0, # Unix epoch
"1970-01-02" => 25570.0,
"2006-02-01" => 38749.0,
- "2038-01-19" => 50424.0, # max date using signed timestamp in 32bit
+ "2038-01-19" => 50424.0 # max date using signed timestamp in 32bit
}
end
tests.each do |date_string, expected|
@@ -51,7 +51,7 @@ class TestDateTimeConverter < Test::Unit::TestCase
"1970-01-01" => 24107.0, # Unix epoch
"1970-01-02" => 24108.0,
"2006-02-01" => 37287.0,
- "2038-01-19" => 48962.0, # max date using signed timestamp in 32bit
+ "2038-01-19" => 48962.0 # max date using signed timestamp in 32bit
}
end
tests.each do |date_string, expected|
@@ -75,7 +75,7 @@ class TestDateTimeConverter < Test::Unit::TestCase
"1970-01-01T00:00:00Z" => 25569.0, # Unix epoch
"1970-01-01T12:00:00Z" => 25569.5,
"2000-01-01T00:00:00Z" => 36526.0,
- "2038-01-19T03:14:07Z" => 50424.134803, # max signed timestamp in 32bit
+ "2038-01-19T03:14:07Z" => 50424.134803 # max signed timestamp in 32bit
}
end
tests.each do |time_string, expected|
@@ -100,7 +100,7 @@ class TestDateTimeConverter < Test::Unit::TestCase
"1970-01-01T00:00:00Z" => 24107.0, # Unix epoch
"1970-01-01T12:00:00Z" => 24107.5,
"2000-01-01T00:00:00Z" => 35064.0,
- "2038-01-19T03:14:07Z" => 48962.134803, # max signed timestamp in 32bit
+ "2038-01-19T03:14:07Z" => 48962.134803 # max signed timestamp in 32bit
}
end
tests.each do |time_string, expected|
diff --git a/test/workbook/worksheet/tc_pivot_table.rb b/test/workbook/worksheet/tc_pivot_table.rb
index e03c5599..85aa14cd 100644
--- a/test/workbook/worksheet/tc_pivot_table.rb
+++ b/test/workbook/worksheet/tc_pivot_table.rb
@@ -161,7 +161,7 @@ class TestPivotTable < Test::Unit::TestCase
pt.data = [
{ref: "Gross amount", num_fmt: 2},
{ref: "Net amount", num_fmt: 2},
- {ref: "Margin", num_fmt: 2},
+ {ref: "Margin", num_fmt: 2}
]
end
@@ -189,7 +189,7 @@ class TestPivotTable < Test::Unit::TestCase
pivot_table = @ws.add_pivot_table('G5:G6', 'A1:E5') do |pt|
pt.rows = ["Date", "Name"]
pt.data = [
- {ref: "Gross amount", num_fmt: 2},
+ {ref: "Gross amount", num_fmt: 2}
]
end
diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb
index c264ec83..8475f5aa 100644
--- a/test/workbook/worksheet/tc_worksheet.rb
+++ b/test/workbook/worksheet/tc_worksheet.rb
@@ -886,7 +886,7 @@ class TestWorksheet < Test::Unit::TestCase
name: "Times New Roman",
sz: 12,
family: 1,
- color: "FFFFFF",
+ color: "FFFFFF"
},
wb.styles.style_index.values.first
)