summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-25 16:55:03 +0200
committerGeremia Taglialatela <[email protected]>2023-05-25 16:55:03 +0200
commit6fe78597ad69742f0343fec0d689183c99cd6b08 (patch)
tree3afec30b0814df781a5e83dfdfce3bf37aedbed1
parent63a6edf1e191cf91fb80717ebae67c78af0d7db5 (diff)
downloadcaxlsx-6fe78597ad69742f0343fec0d689183c99cd6b08.tar.gz
caxlsx-6fe78597ad69742f0343fec0d689183c99cd6b08.zip
Enable Naming cops
Also fix safe minor offenses - Naming/BinaryOperatorParameterName - Naming/HeredocDelimiterCase
-rw-r--r--.rubocop.yml3
-rw-r--r--.rubocop_todo.yml62
-rw-r--r--axlsx.gemspec6
-rw-r--r--lib/axlsx/util/simple_typed_list.rb6
4 files changed, 71 insertions, 6 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 014f6084..a825d0cb 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -34,6 +34,9 @@ Lint:
Minitest:
Enabled: true
+Naming:
+ Enabled: true
+
Performance:
Enabled: true
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index bb6a38f9..cd694c03 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -84,6 +84,68 @@ Lint/UnusedMethodArgument:
- 'lib/axlsx/package.rb'
- 'lib/axlsx/util/validators.rb'
+Naming/AccessorMethodName:
+ Exclude:
+ - 'lib/axlsx/drawing/axes.rb'
+ - 'lib/axlsx/workbook/worksheet/data_validation.rb'
+
+# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
+# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
+# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
+Naming/FileName:
+ Exclude:
+ - 'lib/axlsx/drawing/bar_3D_chart.rb'
+ - 'lib/axlsx/drawing/line_3D_chart.rb'
+ - 'lib/axlsx/drawing/pie_3D_chart.rb'
+ - 'lib/axlsx/drawing/view_3D.rb'
+ - 'test/drawing/tc_bar_3D_chart.rb'
+ - 'test/drawing/tc_pie_3D_chart.rb'
+ - 'test/drawing/tc_view_3D.rb'
+
+# Configuration parameters: EnforcedStyle, AllowedPatterns.
+# SupportedStyles: snake_case, camelCase
+Naming/MethodName:
+ Enabled: false
+
+# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
+# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
+Naming/MethodParameterName:
+ Enabled: false
+
+# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
+# NamePrefix: is_, has_, have_
+# ForbiddenPrefixes: is_, has_, have_
+# AllowedMethods: is_a?
+# MethodDefinitionMacros: define_method, define_singleton_method
+Naming/PredicateName:
+ Exclude:
+ - 'spec/**/*'
+ - 'lib/axlsx/workbook/worksheet/cell.rb'
+ - 'lib/axlsx/workbook/worksheet/worksheet_comments.rb'
+ - 'lib/axlsx/workbook/worksheet/worksheet_drawing.rb'
+
+# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns.
+# SupportedStyles: snake_case, camelCase
+Naming/VariableName:
+ Enabled: false
+
+# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
+# SupportedStyles: snake_case, normalcase, non_integer
+# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
+Naming/VariableNumber:
+ Exclude:
+ - 'lib/axlsx/util/validators.rb'
+ - 'lib/axlsx/workbook/worksheet/cell.rb'
+ - 'lib/axlsx/workbook/worksheet/cell_serializer.rb'
+ - 'lib/axlsx/workbook/worksheet/sheet_protection.rb'
+ - 'test/rels/tc_relationship.rb'
+ - 'test/rels/tc_relationships.rb'
+ - 'test/tc_package.rb'
+ - 'test/workbook/worksheet/tc_cell.rb'
+ - 'test/workbook/worksheet/tc_date_time_converter.rb'
+ - 'test/workbook/worksheet/tc_sheet_view.rb'
+ - 'test/workbook/worksheet/tc_worksheet.rb'
+
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: separated, grouped
diff --git a/axlsx.gemspec b/axlsx.gemspec
index 83531ce4..bf9c0942 100644
--- a/axlsx.gemspec
+++ b/axlsx.gemspec
@@ -11,9 +11,9 @@ Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.summary = "Excel OOXML (xlsx) with charts, styles, images and autowidth columns."
s.license = 'MIT'
- s.description = <<-eof
- xlsx spreadsheet generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx helps you create beautiful Office Open XML Spreadsheet documents ( Excel, Google Spreadsheets, Numbers, LibreOffice) without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.
- eof
+ s.description = <<~MSG
+ xlsx spreadsheet generation with charts, images, automated column width, customizable styles and full schema validation. Axlsx helps you create beautiful Office Open XML Spreadsheet documents (Excel, Google Spreadsheets, Numbers, LibreOffice) without having to understand the entire ECMA specification. Check out the README for some examples of how easy it is. Best of all, you can validate your xlsx file before serialization so you know for sure that anything generated is going to load on your client's machine.
+ MSG
s.files = Dir.glob("{lib/**/*,examples/**/*.rb,examples/**/*.jpeg}") + %w{LICENSE README.md Rakefile CHANGELOG.md .yardopts .yardopts_guide}
s.add_runtime_dependency "htmlentities", "~> 4.3", '>= 4.3.4'
diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb
index c3910fca..c14aef03 100644
--- a/lib/axlsx/util/simple_typed_list.rb
+++ b/lib/axlsx/util/simple_typed_list.rb
@@ -85,12 +85,12 @@ module Axlsx
end
# join operator
- # @param [Array] v the array to join
+ # @param [Array] other the array to join
# @raise [ArgumentError] if any of the values being joined are not
# one of the allowed types
# @return [SimpleTypedList]
- def +(v)
- v.each do |item|
+ def +(other)
+ other.each do |item|
self << item
end
super