diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index cd819dc9bff..0a166335b4e 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AttachmentUploader < GitlabUploader include RecordsUploads::Concern include ObjectStorage::Concern diff --git a/app/uploaders/avatar_uploader.rb b/app/uploaders/avatar_uploader.rb index 5848e6c6994..b29ef57b071 100644 --- a/app/uploaders/avatar_uploader.rb +++ b/app/uploaders/avatar_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class AvatarUploader < GitlabUploader include UploaderHelper include RecordsUploads::Concern diff --git a/app/uploaders/favicon_uploader.rb b/app/uploaders/favicon_uploader.rb index 3639375d474..a0b275b56a9 100644 --- a/app/uploaders/favicon_uploader.rb +++ b/app/uploaders/favicon_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FaviconUploader < AttachmentUploader EXTENSION_WHITELIST = %w[png ico].freeze diff --git a/app/uploaders/file_mover.rb b/app/uploaders/file_mover.rb index bd7736ad74e..a7f8615e9ba 100644 --- a/app/uploaders/file_mover.rb +++ b/app/uploaders/file_mover.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class FileMover attr_reader :secret, :file_name, :model, :update_field diff --git a/app/uploaders/file_uploader.rb b/app/uploaders/file_uploader.rb index 73606eb9f83..21292ddcf44 100644 --- a/app/uploaders/file_uploader.rb +++ b/app/uploaders/file_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # This class breaks the actual CarrierWave concept. # Every uploader should use a base_dir that is model agnostic so we can build # back URLs from base_dir-relative paths saved in the `Upload` model. @@ -117,7 +119,7 @@ class FileUploader < GitlabUploader end def markdown_link - markdown = "[#{markdown_name}](#{secure_url})" + markdown = +"[#{markdown_name}](#{secure_url})" markdown.prepend("!") if image_or_video? || dangerous? markdown end diff --git a/app/uploaders/gitlab_uploader.rb b/app/uploaders/gitlab_uploader.rb index f8a237178d9..7919f126075 100644 --- a/app/uploaders/gitlab_uploader.rb +++ b/app/uploaders/gitlab_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class GitlabUploader < CarrierWave::Uploader::Base class_attribute :options diff --git a/app/uploaders/job_artifact_uploader.rb b/app/uploaders/job_artifact_uploader.rb index 2a5a830ce4f..855cf2fc21c 100644 --- a/app/uploaders/job_artifact_uploader.rb +++ b/app/uploaders/job_artifact_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class JobArtifactUploader < GitlabUploader extend Workhorse::UploadPath include ObjectStorage::Concern diff --git a/app/uploaders/legacy_artifact_uploader.rb b/app/uploaders/legacy_artifact_uploader.rb index efb7893d153..b4d0d752016 100644 --- a/app/uploaders/legacy_artifact_uploader.rb +++ b/app/uploaders/legacy_artifact_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class LegacyArtifactUploader < GitlabUploader extend Workhorse::UploadPath include ObjectStorage::Concern diff --git a/app/uploaders/lfs_object_uploader.rb b/app/uploaders/lfs_object_uploader.rb index eb521a22ebc..f3d32e6b39d 100644 --- a/app/uploaders/lfs_object_uploader.rb +++ b/app/uploaders/lfs_object_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class LfsObjectUploader < GitlabUploader extend Workhorse::UploadPath include ObjectStorage::Concern diff --git a/app/uploaders/namespace_file_uploader.rb b/app/uploaders/namespace_file_uploader.rb index 1085ecb1700..52969762b7d 100644 --- a/app/uploaders/namespace_file_uploader.rb +++ b/app/uploaders/namespace_file_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class NamespaceFileUploader < FileUploader # Re-Override def self.root diff --git a/app/uploaders/object_storage.rb b/app/uploaders/object_storage.rb index b8ecfc4ee2b..dad6e85fb56 100644 --- a/app/uploaders/object_storage.rb +++ b/app/uploaders/object_storage.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'fog/aws' require 'carrierwave/storage/fog' diff --git a/app/uploaders/personal_file_uploader.rb b/app/uploaders/personal_file_uploader.rb index e3898b07730..25474b494ff 100644 --- a/app/uploaders/personal_file_uploader.rb +++ b/app/uploaders/personal_file_uploader.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class PersonalFileUploader < FileUploader # Re-Override def self.root diff --git a/app/uploaders/records_uploads.rb b/app/uploaders/records_uploads.rb index 301f4681fcd..5795065ae11 100644 --- a/app/uploaders/records_uploads.rb +++ b/app/uploaders/records_uploads.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module RecordsUploads module Concern extend ActiveSupport::Concern diff --git a/app/uploaders/uploader_helper.rb b/app/uploaders/uploader_helper.rb index 207928b61d0..2a2b54a9270 100644 --- a/app/uploaders/uploader_helper.rb +++ b/app/uploaders/uploader_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Extra methods for uploader module UploaderHelper IMAGE_EXT = %w[png jpg jpeg gif bmp tiff ico].freeze diff --git a/app/uploaders/workhorse.rb b/app/uploaders/workhorse.rb index 782032cf516..84dc2791b9c 100644 --- a/app/uploaders/workhorse.rb +++ b/app/uploaders/workhorse.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Workhorse module UploadPath def workhorse_upload_path diff --git a/changelogs/unreleased/frozen-string-enable-app-uploaders.yml b/changelogs/unreleased/frozen-string-enable-app-uploaders.yml new file mode 100644 index 00000000000..d43ca8bed8c --- /dev/null +++ b/changelogs/unreleased/frozen-string-enable-app-uploaders.yml @@ -0,0 +1,5 @@ +--- +title: Enable frozen string in apps/validators/*.rb +merge_request: 20382 +author: gfyoung +type: other