summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-27 19:11:11 +0200
committerGeremia Taglialatela <[email protected]>2023-05-31 09:42:51 +0200
commitfcfdfacba9ad18863fc73716c15fb3bd69fd3686 (patch)
treeebe70fff87d3aba81ddf610e9637551096afe538
parent8918a00eb0ff7b40240be5c94c4c245c95579acb (diff)
downloadcaxlsx-fcfdfacba9ad18863fc73716c15fb3bd69fd3686.tar.gz
caxlsx-fcfdfacba9ad18863fc73716c15fb3bd69fd3686.zip
Fix Style/YodaCondition offense
-rw-r--r--.rubocop_todo.yml7
-rw-r--r--lib/axlsx/workbook/worksheet/col.rb2
2 files changed, 1 insertions, 8 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index c53b9f5c..43b9c463 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -515,13 +515,6 @@ Style/WhileUntilModifier:
Style/WordArray:
Enabled: false
-# This cop supports unsafe autocorrection (--autocorrect-all).
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: forbid_for_all_comparison_operators, forbid_for_equality_operators_only, require_for_all_comparison_operators, require_for_equality_operators_only
-Style/YodaCondition:
- Exclude:
- - 'lib/axlsx/workbook/worksheet/col.rb'
-
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
# URISchemes: http, https
diff --git a/lib/axlsx/workbook/worksheet/col.rb b/lib/axlsx/workbook/worksheet/col.rb
index ff942d32..38ac7454 100644
--- a/lib/axlsx/workbook/worksheet/col.rb
+++ b/lib/axlsx/workbook/worksheet/col.rb
@@ -88,7 +88,7 @@ module Axlsx
# @see Col#outline
def outline_level=(v)
Axlsx.validate_unsigned_numeric(v)
- raise ArgumentError, 'outlineLevel must be between 0 and 7' unless 0 <= v && v <= 7
+ raise ArgumentError, 'outlineLevel must be between 0 and 7' unless v >= 0 && v <= 7
@outline_level = v
end