diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 344a880760ea02109bb212533f9971e714a5cc44..bd0f9184cd662d4f256e814b7d1953e0d5298d48 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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: diff --git a/app/finders/projects_finder.rb b/app/finders/projects_finder.rb index 3a84600b09f20cc72d2b8f27c853b9d18100d81d..8846ff54eb20ae4d66b1a01982ccb2dfc50710a6 100644 --- a/app/finders/projects_finder.rb +++ b/app/finders/projects_finder.rb @@ -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) diff --git a/app/helpers/namespaces_helper.rb b/app/helpers/namespaces_helper.rb index 9de28fb3ed91978cb5b40f885e7722e6d53d74fc..228dc2cc27f2eaee7a63794d8e4210b08f4b709c 100644 --- a/app/helpers/namespaces_helper.rb +++ b/app/helpers/namespaces_helper.rb @@ -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 diff --git a/lib/gitlab/ci/build/artifacts/metadata/entry.rb b/lib/gitlab/ci/build/artifacts/metadata/entry.rb index 80e69cdcc959140b7386797938cebfffbb3697f9..ef354832e8e2fdab04a8f3c9ef57ecdf84d5e5d0 100644 --- a/lib/gitlab/ci/build/artifacts/metadata/entry.rb +++ b/lib/gitlab/ci/build/artifacts/metadata/entry.rb @@ -50,7 +50,7 @@ def parent end def basename - (directory? && !blank_node?) ? name + '/' : name + directory? && !blank_node? ? name + '/' : name end def name diff --git a/spec/requests/api/pipeline_schedules_spec.rb b/spec/requests/api/pipeline_schedules_spec.rb index 14b292db04568a5daaf93d05891c08a7c4d8ee11..98eaf36b14e2a71053c9370ca9e28e8120d2810d 100644 --- a/spec/requests/api/pipeline_schedules_spec.rb +++ b/spec/requests/api/pipeline_schedules_spec.rb @@ -67,7 +67,7 @@ def create_pipeline_schedules(count) end def active?(str) - (str == 'active') ? true : false + str == 'active' end end end diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 90adfb1a2eecfd2690e83d890ccc79fe6fe683b7..e80b69e4fd56cd4f3e7b1f9574ef0b1f292bac24 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -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)