lib/codeowners/checker/line_grouper.rb in codeowners-checker-1.0.0 vs lib/codeowners/checker/line_grouper.rb in codeowners-checker-1.0.1

- old
+ new

@@ -11,10 +11,13 @@ def initialize(group, lines) @group_buffer = [group] @lines = lines end + # rubocop:disable Metrics/AbcSize + # rubocop:disable Metrics/CyclomaticComplexity + # rubocop:disable Metrics/MethodLength def call lines.each_with_index do |line, index| case line when Codeowners::Checker::Group::Empty ensure_groups_structure @@ -44,19 +47,22 @@ end current_group.add(line) end group_buffer.first end + # rubocop:enable Metrics/AbcSize + # rubocop:enable Metrics/CyclomaticComplexity + # rubocop:enable Metrics/MethodLength private attr_reader :group_buffer, :lines def previous_line_empty?(index) index.positive? && lines[index - 1].is_a?(Codeowners::Checker::Group::Empty) end - def new_owner?(line, index) + def new_owner?(line, index) # rubocop:disable Metrics/MethodLength if previous_line_empty?(index) offset = 2 while (index - offset).positive? case lines[index - offset] when Codeowners::Checker::Group::GroupEndComment