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: ...@@ -613,18 +613,6 @@ Style/StringLiteralsInInterpolation:
Style/SymbolProc: Style/SymbolProc:
Enabled: false 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 # Offense count: 99
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/UnneededInterpolation: Style/UnneededInterpolation:
......
...@@ -151,11 +151,11 @@ class ProjectsFinder < UnionFinder ...@@ -151,11 +151,11 @@ class ProjectsFinder < UnionFinder
end end
def by_personal(items) 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 end
def by_starred(items) 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 end
def by_trending(items) def by_trending(items)
......
...@@ -80,8 +80,8 @@ module NamespacesHelper ...@@ -80,8 +80,8 @@ module NamespacesHelper
visibility_level: n.visibility_level_value, visibility_level: n.visibility_level_value,
visibility: n.visibility, visibility: n.visibility,
name: n.name, name: n.name,
show_path: (type == 'group') ? group_path(n) : user_path(n), show_path: type == 'group' ? group_path(n) : user_path(n),
edit_path: (type == 'group') ? edit_group_path(n) : nil edit_path: type == 'group' ? edit_group_path(n) : nil
}] }]
end end
......
...@@ -50,7 +50,7 @@ module Gitlab ...@@ -50,7 +50,7 @@ module Gitlab
end end
def basename def basename
(directory? && !blank_node?) ? name + '/' : name directory? && !blank_node? ? name + '/' : name
end end
def name def name
......
...@@ -67,7 +67,7 @@ describe API::PipelineSchedules do ...@@ -67,7 +67,7 @@ describe API::PipelineSchedules do
end end
def active?(str) def active?(str)
(str == 'active') ? true : false str == 'active'
end end
end end
end end
......
...@@ -7,7 +7,7 @@ require 'capybara-screenshot/rspec' ...@@ -7,7 +7,7 @@ require 'capybara-screenshot/rspec'
require 'selenium-webdriver' require 'selenium-webdriver'
# Give CI some extra time # 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 # Define an error class for JS console messages
JSConsoleError = Class.new(StandardError) 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