Lint: avoid multi-line ternary operator

This commit is contained in:
Olle Jonsson 2016-09-22 19:17:23 +02:00
parent 04215618a2
commit 7f8131d5cd

View File

@ -131,11 +131,14 @@ module GitHubChangelogGenerator
end
def filter_by_include_labels(issues)
filtered_issues = @options[:include_labels].nil? ? issues : issues.select do |issue|
labels = issue.labels.map(&:name) & @options[:include_labels]
labels.any?
if @options[:include_labels].nil?
issues
else
issues.select do |issue|
labels = issue.labels.map(&:name) & @options[:include_labels]
labels.any?
end
end
filtered_issues
end
# General filtered function