Skip to content
Snippets Groups Projects
Commit fbde8354 authored by gfyoung's avatar gfyoung
Browse files

Enable more frozen string in app/services/**/*.rb

Partially addresses #47424.
parent 489025bb
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Showing
with 46 additions and 3 deletions
# frozen_string_literal: true
module Lfs
# Usage: Calling `new_file` check to see if a file should be in LFS and
# return a transformed result with `content` and `encoding` to commit.
Loading
Loading
# frozen_string_literal: true
module Lfs
class LockFileService < BaseService
def execute
Loading
Loading
# frozen_string_literal: true
module Lfs
class LocksFinderService < BaseService
def execute
Loading
Loading
# frozen_string_literal: true
module Lfs
class UnlockFileService < BaseService
def execute
Loading
Loading
# frozen_string_literal: true
module Mattermost
class CreateTeamService < ::BaseService
def initialize(group, current_user)
Loading
Loading
# frozen_string_literal: true
module Members
class ApproveAccessRequestService < Members::BaseService
def execute(access_requester, skip_authorization: false, skip_log_audit_event: false)
Loading
Loading
# frozen_string_literal: true
module Members
class BaseService < ::BaseService
# current_user - The user that performs the action
Loading
Loading
# frozen_string_literal: true
module Members
class CreateService < Members::BaseService
DEFAULT_LIMIT = 100
Loading
Loading
# frozen_string_literal: true
module Members
class DestroyService < Members::BaseService
def execute(member, skip_authorization: false)
Loading
Loading
# frozen_string_literal: true
module Members
class RequestAccessService < Members::BaseService
def execute(source)
Loading
Loading
# frozen_string_literal: true
module Members
class UpdateService < Members::BaseService
# returns the updated member
Loading
Loading
# frozen_string_literal: true
module MergeRequests
class AddTodoWhenBuildFailsService < MergeRequests::BaseService
# Adds a todo to the parent merge_request when a CI build fails
Loading
Loading
# frozen_string_literal: true
module MergeRequests
class AssignIssuesService < BaseService
def assignable_issues
Loading
Loading
# frozen_string_literal: true
module MergeRequests
class BaseService < ::IssuableBaseService
def create_note(merge_request, state = merge_request.state)
Loading
Loading
# frozen_string_literal: true
module MergeRequests
class BuildService < MergeRequests::BaseService
include Gitlab::Utils::StrongMemoize
Loading
Loading
@@ -140,7 +142,8 @@ module MergeRequests
closes_issue = "Closes #{issue.to_reference}"
 
if description.present?
merge_request.description += closes_issue.prepend("\n\n")
descr_parts = [merge_request.description, closes_issue]
merge_request.description = descr_parts.join("\n\n")
else
merge_request.description = closes_issue
end
Loading
Loading
@@ -164,9 +167,11 @@ module MergeRequests
return if merge_request.title.present?
 
if issue_iid.present?
merge_request.title = "Resolve #{issue.to_reference}"
title_parts = ["Resolve #{issue.to_reference}"]
branch_title = source_branch.downcase.remove(issue_iid.downcase).titleize.humanize
merge_request.title += " \"#{branch_title}\"" if branch_title.present?
title_parts << "\"#{branch_title}\"" if branch_title.present?
merge_request.title = title_parts.join(' ')
end
end
 
Loading
Loading
# frozen_string_literal: true
module MergeRequests
class CloseService < MergeRequests::BaseService
def execute(merge_request, commit = nil)
Loading
Loading
# frozen_string_literal: true
module MergeRequests
module Conflicts
class BaseService
Loading
Loading
# frozen_string_literal: true
module MergeRequests
module Conflicts
class ListService < MergeRequests::Conflicts::BaseService
Loading
Loading
# frozen_string_literal: true
module MergeRequests
module Conflicts
class ResolveService < MergeRequests::Conflicts::BaseService
Loading
Loading
# frozen_string_literal: true
module MergeRequests
class CreateFromIssueService < MergeRequests::CreateService
def initialize(project, user, params)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment