From 7f8131d5cd45fecd4b73e39d1eef1e15670750db Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Thu, 22 Sep 2016 19:17:23 +0200 Subject: [PATCH] Lint: avoid multi-line ternary operator --- .../generator/generator_processor.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/github_changelog_generator/generator/generator_processor.rb b/lib/github_changelog_generator/generator/generator_processor.rb index ca03f6d..1e9c094 100644 --- a/lib/github_changelog_generator/generator/generator_processor.rb +++ b/lib/github_changelog_generator/generator/generator_processor.rb @@ -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