Skip to content
代码片段 群组 项目
提交 7ec0b7b5 编辑于 作者: Igor Drozdov's avatar Igor Drozdov
浏览文件

Fix Style/TernaryParentheses offenses

The cop checks for unneeded parentheses for ternary operators
It would be cool to have it enabled for all files
上级 1e39f6f5
No related branches found
No related tags found
无相关合并请求
......@@ -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 @@ def union(items)
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 @@ def options_for_group(namespaces, display_path:, type:)
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 @@ def parent
end
def basename
(directory? && !blank_node?) ? name + '/' : name
directory? && !blank_node? ? name + '/' : name
end
def name
......
......@@ -67,7 +67,7 @@ def create_pipeline_schedules(count)
end
def active?(str)
(str == 'active') ? true : false
str == 'active'
end
end
end
......
......@@ -7,7 +7,7 @@
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)
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册