Commit f3faf32e authored by Robert Speicher's avatar Robert Speicher

Auto-correct EE-only offenses for Layout/TrailingWhitespace

parent 1ce6142c
class Projects::PushRulesController < Projects::ApplicationController class Projects::PushRulesController < Projects::ApplicationController
include RepositorySettingsRedirect include RepositorySettingsRedirect
# Authorize # Authorize
before_action :authorize_admin_project! before_action :authorize_admin_project!
before_action :check_push_rules_available! before_action :check_push_rules_available!
......
...@@ -3,7 +3,7 @@ if Rails.env.test? ...@@ -3,7 +3,7 @@ if Rails.env.test?
def pid def pid
render plain: Process.pid.to_s render plain: Process.pid.to_s
end end
def kill def kill
Process.kill(params[:signal], Process.pid) Process.kill(params[:signal], Process.pid)
render plain: 'Bye!' render plain: 'Bye!'
......
...@@ -3,7 +3,7 @@ class AdminEmailsWorker ...@@ -3,7 +3,7 @@ class AdminEmailsWorker
include DedicatedSidekiqQueue include DedicatedSidekiqQueue
def perform(recipient_id, subject, body) def perform(recipient_id, subject, body)
recipient_list(recipient_id).pluck(:id).uniq.each do |user_id| recipient_list(recipient_id).pluck(:id).uniq.each do |user_id|
Notify.send_admin_notification(user_id, subject, body).deliver_later Notify.send_admin_notification(user_id, subject, body).deliver_later
end end
end end
......
...@@ -56,7 +56,7 @@ class Spinach::Features::AdminLicense < Spinach::FeatureSteps ...@@ -56,7 +56,7 @@ class Spinach::Features::AdminLicense < Spinach::FeatureSteps
license = build(:gitlab_license) license = build(:gitlab_license)
File.write(path, license.export) File.write(path, license.export)
attach_file 'license_data_file', path attach_file 'license_data_file', path
click_button "Upload license" click_button "Upload license"
end end
......
module Audit module Audit
class Details class Details
ACTIONS = %i[add remove failed_login change].freeze ACTIONS = %i[add remove failed_login change].freeze
def self.humanize(*args) def self.humanize(*args)
new(*args).humanize new(*args).humanize
end end
def initialize(details) def initialize(details)
@details = details @details = details
end end
def humanize def humanize
if @details[:with] if @details[:with]
"Signed in with #{@details[:with].upcase} authentication" "Signed in with #{@details[:with].upcase} authentication"
...@@ -17,9 +17,9 @@ module Audit ...@@ -17,9 +17,9 @@ module Audit
action_text action_text
end end
end end
private private
def action_text def action_text
action = @details.slice(*ACTIONS) action = @details.slice(*ACTIONS)
value = @details.values.first.tr('_', ' ') value = @details.values.first.tr('_', ' ')
......
...@@ -127,7 +127,7 @@ module Gitlab ...@@ -127,7 +127,7 @@ module Gitlab
def send_artifacts_entry(build, entry) def send_artifacts_entry(build, entry)
file = build.artifacts_file file = build.artifacts_file
archive = archive =
if file.file_storage? if file.file_storage?
file.path file.path
else else
......
...@@ -122,7 +122,7 @@ describe Projects::IssuesController do ...@@ -122,7 +122,7 @@ describe Projects::IssuesController do
_ = issue2 _ = issue2
perform :get, :index, weight: 1 perform :get, :index, weight: 1
expect(response).to have_http_status(200) expect(response).to have_http_status(200)
expect(assigns(:issues)).to eq([issue2]) expect(assigns(:issues)).to eq([issue2])
end end
......
...@@ -9,7 +9,7 @@ describe Projects::PushRulesController do ...@@ -9,7 +9,7 @@ describe Projects::PushRulesController do
sign_in(user) sign_in(user)
end end
describe '#update' do describe '#update' do
def do_update def do_update
patch :update, namespace_id: project.namespace, project_id: project, id: 1, push_rule: { prevent_secrets: true } patch :update, namespace_id: project.namespace, project_id: project, id: 1, push_rule: { prevent_secrets: true }
......
...@@ -39,7 +39,7 @@ describe Gitlab::OAuth::User do ...@@ -39,7 +39,7 @@ describe Gitlab::OAuth::User do
{ provider: 'ldapmain', extern_uid: "uid=#{uid},#{base_dn}" }, { provider: 'ldapmain', extern_uid: "uid=#{uid},#{base_dn}" },
{ provider: 'kerberos', extern_uid: uid + '@' + realm } { provider: 'kerberos', extern_uid: uid + '@' + realm }
) )
expect(gl_user.email).to eq(real_email) expect(gl_user.email).to eq(real_email)
end end
end end
......
...@@ -55,7 +55,7 @@ describe SshHostKey do ...@@ -55,7 +55,7 @@ describe SshHostKey do
expected = [key1, key2] expected = [key1, key2]
.map { |data| Gitlab::KeyFingerprint.new(data) } .map { |data| Gitlab::KeyFingerprint.new(data) }
.each_with_index .each_with_index
.map { |key, i| { bits: key.bits, fingerprint: key.fingerprint, type: key.type, index: i } } .map { |key, i| { bits: key.bits, fingerprint: key.fingerprint, type: key.type, index: i } }
expect(ssh_host_key.fingerprints.as_json).to eq(expected) expect(ssh_host_key.fingerprints.as_json).to eq(expected)
end end
......
...@@ -7,7 +7,7 @@ FactoryGirl.define do ...@@ -7,7 +7,7 @@ FactoryGirl.define do
end end
source_job factory: :ci_build source_job factory: :ci_build
pipeline factory: :ci_empty_pipeline pipeline factory: :ci_empty_pipeline
end end
end end
...@@ -171,7 +171,7 @@ feature 'Project mirror', js: true do ...@@ -171,7 +171,7 @@ feature 'Project mirror', js: true do
click_without_sidekiq 'Save changes' click_without_sidekiq 'Save changes'
expect(page).to have_content(key.fingerprint) expect(page).to have_content(key.fingerprint)
expect(page).to have_content("Verified by #{h(user.name)} less than a minute ago") expect(page).to have_content("Verified by #{h(user.name)} less than a minute ago")
end end
end end
end end
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Audit::Details do describe Audit::Details do
let(:user) { create(:user) } let(:user) { create(:user) }
describe '.humanize' do describe '.humanize' do
context 'user' do context 'user' do
let(:login_action) do let(:login_action) do
...@@ -13,12 +13,12 @@ describe Audit::Details do ...@@ -13,12 +13,12 @@ describe Audit::Details do
target_details: user.name target_details: user.name
} }
end end
it 'humanizes user login action' do it 'humanizes user login action' do
expect(described_class.humanize(login_action)).to eq('Signed in with LDAP authentication') expect(described_class.humanize(login_action)).to eq('Signed in with LDAP authentication')
end end
end end
context 'project' do context 'project' do
let(:user_member) { create(:user) } let(:user_member) { create(:user) }
let(:project) { create(:project) } let(:project) { create(:project) }
...@@ -33,12 +33,12 @@ describe Audit::Details do ...@@ -33,12 +33,12 @@ describe Audit::Details do
target_details: member.user.name target_details: member.user.name
} }
end end
it 'humanizes add project member access action' do it 'humanizes add project member access action' do
expect(described_class.humanize(member_access_action)).to eq('Added user access as Developer') expect(described_class.humanize(member_access_action)).to eq('Added user access as Developer')
end end
end end
context 'group' do context 'group' do
let(:user_member) { create(:user) } let(:user_member) { create(:user) }
let(:group) { create(:group) } let(:group) { create(:group) }
...@@ -54,12 +54,12 @@ describe Audit::Details do ...@@ -54,12 +54,12 @@ describe Audit::Details do
target_details: member.user.name target_details: member.user.name
} }
end end
it 'humanizes add group member access action' do it 'humanizes add group member access action' do
expect(described_class.humanize(member_access_action)).to eq('Changed access level from Guest to Owner') expect(described_class.humanize(member_access_action)).to eq('Changed access level from Guest to Owner')
end end
end end
context 'deploy key' do context 'deploy key' do
let(:removal_action) do let(:removal_action) do
{ {
......
...@@ -2,10 +2,10 @@ require 'spec_helper' ...@@ -2,10 +2,10 @@ require 'spec_helper'
describe Gitlab::PaginationDelegate do describe Gitlab::PaginationDelegate do
context 'no data' do context 'no data' do
let(:delegate) do let(:delegate) do
described_class.new(page: 1, described_class.new(page: 1,
per_page: 10, per_page: 10,
count: 0) count: 0)
end end
it 'shows the correct total count' do it 'shows the correct total count' do
...@@ -46,10 +46,10 @@ describe Gitlab::PaginationDelegate do ...@@ -46,10 +46,10 @@ describe Gitlab::PaginationDelegate do
end end
context 'with data' do context 'with data' do
let(:delegate) do let(:delegate) do
described_class.new(page: 5, described_class.new(page: 5,
per_page: 100, per_page: 100,
count: 1000) count: 1000)
end end
it 'shows the correct total count' do it 'shows the correct total count' do
...@@ -90,10 +90,10 @@ describe Gitlab::PaginationDelegate do ...@@ -90,10 +90,10 @@ describe Gitlab::PaginationDelegate do
end end
context 'last page' do context 'last page' do
let(:delegate) do let(:delegate) do
described_class.new(page: 10, described_class.new(page: 10,
per_page: 100, per_page: 100,
count: 1000) count: 1000)
end end
it 'shows the correct total count' do it 'shows the correct total count' do
......
...@@ -7,7 +7,7 @@ describe Ci::Sources::Pipeline do ...@@ -7,7 +7,7 @@ describe Ci::Sources::Pipeline do
it { is_expected.to belong_to(:source_project) } it { is_expected.to belong_to(:source_project) }
it { is_expected.to belong_to(:source_job) } it { is_expected.to belong_to(:source_job) }
it { is_expected.to belong_to(:source_pipeline) } it { is_expected.to belong_to(:source_pipeline) }
it { is_expected.to validate_presence_of(:project) } it { is_expected.to validate_presence_of(:project) }
it { is_expected.to validate_presence_of(:pipeline) } it { is_expected.to validate_presence_of(:pipeline) }
......
...@@ -32,7 +32,7 @@ describe 'gitlab:artifacts namespace rake task' do ...@@ -32,7 +32,7 @@ describe 'gitlab:artifacts namespace rake task' do
stub_artifacts_object_storage stub_artifacts_object_storage
job job
end end
it "migrates file to remote storage" do it "migrates file to remote storage" do
subject subject
......
...@@ -18,7 +18,7 @@ describe ArtifactUploader do ...@@ -18,7 +18,7 @@ describe ArtifactUploader do
describe '.artifacts_upload_path' do describe '.artifacts_upload_path' do
subject { described_class.artifacts_upload_path } subject { described_class.artifacts_upload_path }
it { is_expected.to start_with(local_path) } it { is_expected.to start_with(local_path) }
it { is_expected.to end_with('tmp/uploads/') } it { is_expected.to end_with('tmp/uploads/') }
end end
...@@ -35,7 +35,7 @@ describe ArtifactUploader do ...@@ -35,7 +35,7 @@ describe ArtifactUploader do
context 'when using remote storage' do context 'when using remote storage' do
let(:store) { described_class::REMOTE_STORE } let(:store) { described_class::REMOTE_STORE }
before do before do
stub_artifacts_object_storage stub_artifacts_object_storage
end end
......
...@@ -133,7 +133,7 @@ describe ObjectStoreUploader do ...@@ -133,7 +133,7 @@ describe ObjectStoreUploader do
let(:job) { create(:ci_build, :artifacts, artifacts_file_store: store) } let(:job) { create(:ci_build, :artifacts, artifacts_file_store: store) }
let(:uploader) { job.artifacts_file } let(:uploader) { job.artifacts_file }
let(:store) { described_class::LOCAL_STORE } let(:store) { described_class::LOCAL_STORE }
subject { uploader.migrate!(new_store) } subject { uploader.migrate!(new_store) }
context 'when using the same storage' do context 'when using the same storage' do
...@@ -149,7 +149,7 @@ describe ObjectStoreUploader do ...@@ -149,7 +149,7 @@ describe ObjectStoreUploader do
context 'when migrating to local storage' do context 'when migrating to local storage' do
let(:store) { described_class::REMOTE_STORE } let(:store) { described_class::REMOTE_STORE }
let(:new_store) { described_class::LOCAL_STORE } let(:new_store) { described_class::LOCAL_STORE }
before do before do
stub_artifacts_object_storage stub_artifacts_object_storage
end end
...@@ -173,10 +173,10 @@ describe ObjectStoreUploader do ...@@ -173,10 +173,10 @@ describe ObjectStoreUploader do
it "file does exist" do it "file does exist" do
expect(File.exist?(current_path)).to eq(true) expect(File.exist?(current_path)).to eq(true)
end end
context 'when storage is disabled' do context 'when storage is disabled' do
before do before do
stub_artifacts_object_storage(enabled: false) stub_artifacts_object_storage(enabled: false)
end end
it "to raise an error" do it "to raise an error" do
...@@ -198,7 +198,7 @@ describe ObjectStoreUploader do ...@@ -198,7 +198,7 @@ describe ObjectStoreUploader do
it "does delete original file" do it "does delete original file" do
subject subject
expect(File.exist?(current_path)).to eq(false) expect(File.exist?(current_path)).to eq(false)
end end
......
...@@ -74,7 +74,7 @@ describe UpdateAllMirrorsWorker do ...@@ -74,7 +74,7 @@ describe UpdateAllMirrorsWorker do
def schedule_mirrors!(capacity:) def schedule_mirrors!(capacity:)
allow(Gitlab::Mirror).to receive_messages(available_capacity: capacity) allow(Gitlab::Mirror).to receive_messages(available_capacity: capacity)
Sidekiq::Testing.fake! do Sidekiq::Testing.fake! do
worker.schedule_mirrors! worker.schedule_mirrors!
end end
end end
......
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