lib/rubocop/cop/mixin/hash_alignment.rb in rubocop-0.70.0 vs lib/rubocop/cop/mixin/hash_alignment.rb in rubocop-0.71.0
- old
+ new
@@ -81,9 +81,13 @@
# Handles calculation of deltas when the enforced style is 'table'.
class TableAlignment
include ValueAlignment
+ def initialize
+ self.max_key_width = 0
+ end
+
def deltas_for_first_pair(first_pair, node)
self.max_key_width = node.keys.map { |key| key.source.length }.max
separator_delta = separator_delta(first_pair, first_pair, 0)
{