Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use permitted in line_length.rb #6464

Merged
merged 1 commit into from
Nov 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rubocop/cop/metrics/line_length.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def check_line(line, index, heredocs)

def ignored_line?(line, index, heredocs)
matches_ignored_pattern?(line) ||
heredocs && line_in_whitelisted_heredoc?(heredocs, index.succ)
heredocs && line_in_permitted_heredoc?(heredocs, index.succ)
end

def register_offense(loc, line)
Expand Down Expand Up @@ -107,7 +107,7 @@ def extract_heredocs(ast)
end
end

def line_in_whitelisted_heredoc?(heredocs, line_number)
def line_in_permitted_heredoc?(heredocs, line_number)
heredocs.any? do |range, delimiter|
range.cover?(line_number) &&
(allowed_heredoc == true || allowed_heredoc.include?(delimiter))
Expand Down