Commit 8bffa33e authored by Stan Hu's avatar Stan Hu

Merge branch 'id-fix-ternary-parentheses-offenses' into 'master'

Fix Style/TernaryParentheses offenses

See merge request gitlab-org/gitlab!30199
parents 2397df43 7ec0b7b5
......@@ -613,18 +613,6 @@ Style/StringLiteralsInInterpolation:
Style/SymbolProc:
Enabled: false
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
Style/TernaryParentheses:
Exclude:
- 'app/finders/projects_finder.rb'
- 'app/helpers/namespaces_helper.rb'
- 'lib/gitlab/ci/build/artifacts/metadata/entry.rb'
- 'spec/requests/api/pipeline_schedules_spec.rb'
- 'spec/support/capybara.rb'
# Offense count: 99
# Cop supports --auto-correct.
Style/UnneededInterpolation:
......
......@@ -151,11 +151,11 @@ class ProjectsFinder < UnionFinder
end
def by_personal(items)
(params[:personal].present? && current_user) ? items.personal(current_user) : items
params[:personal].present? && current_user ? items.personal(current_user) : items
end
def by_starred(items)
(params[:starred].present? && current_user) ? items.starred_by(current_user) : items
params[:starred].present? && current_user ? items.starred_by(current_user) : items
end
def by_trending(items)
......
......@@ -80,8 +80,8 @@ module NamespacesHelper
visibility_level: n.visibility_level_value,
visibility: n.visibility,
name: n.name,
show_path: (type == 'group') ? group_path(n) : user_path(n),
edit_path: (type == 'group') ? edit_group_path(n) : nil
show_path: type == 'group' ? group_path(n) : user_path(n),
edit_path: type == 'group' ? edit_group_path(n) : nil
}]
end
......
......@@ -50,7 +50,7 @@ module Gitlab
end
def basename
(directory? && !blank_node?) ? name + '/' : name
directory? && !blank_node? ? name + '/' : name
end
def name
......
......@@ -67,7 +67,7 @@ describe API::PipelineSchedules do
end
def active?(str)
(str == 'active') ? true : false
str == 'active'
end
end
end
......
......@@ -7,7 +7,7 @@ require 'capybara-screenshot/rspec'
require 'selenium-webdriver'
# Give CI some extra time
timeout = (ENV['CI'] || ENV['CI_SERVER']) ? 60 : 30
timeout = ENV['CI'] || ENV['CI_SERVER'] ? 60 : 30
# Define an error class for JS console messages
JSConsoleError = Class.new(StandardError)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment