summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZsolt Kozaroczy <[email protected]>2023-05-31 09:07:58 +0200
committerGitHub <[email protected]>2023-05-31 09:07:58 +0200
commitcbd31927743cf502f9eb85473d68059b31bbf2f7 (patch)
treed2767dc7ac287c4a7b15b13a1749a4fc0825a426
parentc1061e34e294f87030128abf1730fcf4a5ecb406 (diff)
parent6fe78597ad69742f0343fec0d689183c99cd6b08 (diff)
downloadcaxlsx-cbd31927743cf502f9eb85473d68059b31bbf2f7.tar.gz
caxlsx-cbd31927743cf502f9eb85473d68059b31bbf2f7.zip
Merge pull request #259 from tagliala/chore/enable-naming-cops
Enable Naming cops
-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 9e24c6ea..e536dd97 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -79,6 +79,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 e74e25e3..30cfd2a5 100644
--- a/lib/axlsx/util/simple_typed_list.rb
+++ b/lib/axlsx/util/simple_typed_list.rb
@@ -91,12 +91,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