Skip to content
Snippets Groups Projects
Commit 0430b764 authored by Grzegorz Bizon's avatar Grzegorz Bizon Committed by Rémy Coutable
Browse files

Enable Style/DotPosition Rubocop 👮

parent 78ee24ba
No related branches found
No related tags found
No related merge requests found
Showing
with 56 additions and 58 deletions
Loading
Loading
@@ -164,6 +164,11 @@ Style/DefWithParentheses:
Style/Documentation:
Enabled: false
 
# Multi-line method chaining should be done with leading dots.
Style/DotPosition:
Enabled: true
EnforcedStyle: leading
# This cop checks for uses of double negation (!!) to convert something
# to a boolean value. As this is both cryptic and usually redundant, it
# should be avoided.
Loading
Loading
Loading
Loading
@@ -88,13 +88,6 @@ Security/YAMLLoad:
Style/BarePercentLiterals:
Enabled: false
 
# Offense count: 1403
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: leading, trailing
Style/DotPosition:
Enabled: false
# Offense count: 5
# Cop supports --auto-correct.
Style/EachWithObject:
Loading
Loading
Loading
Loading
@@ -97,8 +97,8 @@ module CreatesCommit
def merge_request_exists?
return @merge_request if defined?(@merge_request)
 
@merge_request = MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened.
find_by(source_project_id: @project_to_commit_into, source_branch: @branch_name, target_branch: @start_branch)
@merge_request = MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened
.find_by(source_project_id: @project_to_commit_into, source_branch: @branch_name, target_branch: @start_branch)
end
 
def different_project?
Loading
Loading
Loading
Loading
@@ -15,8 +15,8 @@ module MembershipActions
end
 
def destroy
Members::DestroyService.new(membershipable, current_user, params).
execute(:all)
Members::DestroyService.new(membershipable, current_user, params)
.execute(:all)
 
respond_to do |format|
format.html do
Loading
Loading
@@ -42,8 +42,8 @@ module MembershipActions
end
 
def leave
member = Members::DestroyService.new(membershipable, current_user, user_id: current_user.id).
execute(:all)
member = Members::DestroyService.new(membershipable, current_user, user_id: current_user.id)
.execute(:all)
 
notice =
if member.request?
Loading
Loading
Loading
Loading
@@ -22,8 +22,8 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
 
def starred
@projects = load_projects(params.merge(starred: true)).
includes(:forked_from_project, :tags).page(params[:page])
@projects = load_projects(params.merge(starred: true))
.includes(:forked_from_project, :tags).page(params[:page])
 
@groups = []
 
Loading
Loading
@@ -45,8 +45,8 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
 
def load_projects(finder_params)
ProjectsFinder.new(params: finder_params, current_user: current_user).
execute.includes(:route, namespace: :route)
ProjectsFinder.new(params: finder_params, current_user: current_user)
.execute.includes(:route, namespace: :route)
end
 
def load_events
Loading
Loading
Loading
Loading
@@ -49,7 +49,7 @@ class Explore::ProjectsController < Explore::ApplicationController
private
 
def load_projects
ProjectsFinder.new(current_user: current_user, params: params).
execute.includes(:route, namespace: :route)
ProjectsFinder.new(current_user: current_user, params: params)
.execute.includes(:route, namespace: :route)
end
end
Loading
Loading
@@ -11,8 +11,8 @@ class JwtController < ApplicationController
service = SERVICES[params[:service]]
return head :not_found unless service
 
result = service.new(@authentication_result.project, @authentication_result.actor, auth_params).
execute(authentication_abilities: @authentication_result.authentication_abilities)
result = service.new(@authentication_result.project, @authentication_result.actor, auth_params)
.execute(authentication_abilities: @authentication_result.authentication_abilities)
 
render json: result, status: result[:http_status]
end
Loading
Loading
Loading
Loading
@@ -144,7 +144,7 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
end
 
def log_audit_event(user, options = {})
AuditEventService.new(user, user, options).
for_authentication.security_event
AuditEventService.new(user, user, options)
.for_authentication.security_event
end
end
Loading
Loading
@@ -49,9 +49,9 @@ class ProfilesController < Profiles::ApplicationController
end
 
def audit_log
@events = AuditEvent.where(entity_type: "User", entity_id: current_user.id).
order("created_at DESC").
page(params[:page])
@events = AuditEvent.where(entity_type: "User", entity_id: current_user.id)
.order("created_at DESC")
.page(params[:page])
end
 
def update_username
Loading
Loading
Loading
Loading
@@ -187,7 +187,7 @@ class Projects::BlobController < Projects::ApplicationController
end
 
def set_last_commit_sha
@last_commit_sha = Gitlab::Git::Commit.
last_for_path(@repository, @ref, @path).sha
@last_commit_sha = Gitlab::Git::Commit
.last_for_path(@repository, @ref, @path).sha
end
end
Loading
Loading
@@ -37,8 +37,8 @@ class Projects::BranchesController < Projects::ApplicationController
 
redirect_to_autodeploy = project.empty_repo? && project.deployment_services.present?
 
result = CreateBranchService.new(project, current_user).
execute(branch_name, ref)
result = CreateBranchService.new(project, current_user)
.execute(branch_name, ref)
 
if params[:issue_iid]
issue = IssuesFinder.new(current_user, project_id: @project.id).find_by(iid: params[:issue_iid])
Loading
Loading
Loading
Loading
@@ -18,11 +18,11 @@ class Projects::CommitsController < Projects::ApplicationController
@repository.commits(@ref, path: @path, limit: @limit, offset: @offset)
end
 
@note_counts = project.notes.where(commit_id: @commits.map(&:id)).
group(:commit_id).count
@note_counts = project.notes.where(commit_id: @commits.map(&:id))
.group(:commit_id).count
 
@merge_request = MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened.
find_by(source_project: @project, source_branch: @ref, target_branch: @repository.root_ref)
@merge_request = MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened
.find_by(source_project: @project, source_branch: @ref, target_branch: @repository.root_ref)
 
respond_to do |format|
format.html
Loading
Loading
Loading
Loading
@@ -61,7 +61,7 @@ class Projects::CompareController < Projects::ApplicationController
end
 
def merge_request
@merge_request ||= MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened.
find_by(source_project: @project, source_branch: @head_ref, target_branch: @start_ref)
@merge_request ||= MergeRequestsFinder.new(current_user, project_id: @project.id).execute.opened
.find_by(source_project: @project, source_branch: @head_ref, target_branch: @start_ref)
end
end
Loading
Loading
@@ -143,8 +143,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
# Get commits from repository
# or from cache if already merged
@commits = @merge_request.commits
@note_counts = Note.where(commit_id: @commits.map(&:id)).
group(:commit_id).count
@note_counts = Note.where(commit_id: @commits.map(&:id))
.group(:commit_id).count
 
render json: { html: view_to_html_string('projects/merge_requests/show/_commits') }
end
Loading
Loading
@@ -192,9 +192,9 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
 
begin
MergeRequests::Conflicts::ResolveService.
new(merge_request).
execute(current_user, params)
MergeRequests::Conflicts::ResolveService
.new(merge_request)
.execute(current_user, params)
 
flash[:notice] = 'All merge conflicts were resolved. The merge request can now be merged.'
 
Loading
Loading
@@ -562,8 +562,8 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@commits = @merge_request.compare_commits.reverse
@commit = @merge_request.diff_head_commit
 
@note_counts = Note.where(commit_id: @commits.map(&:id)).
group(:commit_id).count
@note_counts = Note.where(commit_id: @commits.map(&:id))
.group(:commit_id).count
 
@labels = LabelsFinder.new(current_user, project_id: @project.id).execute
 
Loading
Loading
Loading
Loading
@@ -14,8 +14,8 @@ module Projects
 
def define_runners_variables
@project_runners = @project.runners.ordered
@assignable_runners = current_user.ci_authorized_runners.
assignable_for(project).ordered.page(params[:page]).per(20)
@assignable_runners = current_user.ci_authorized_runners
.assignable_for(project).ordered.page(params[:page]).per(20)
@shared_runners = Ci::Runner.shared.active
@shared_runners_count = @shared_runners.count(:all)
end
Loading
Loading
Loading
Loading
@@ -29,8 +29,8 @@ class Projects::TagsController < Projects::ApplicationController
end
 
def create
result = Tags::CreateService.new(@project, current_user).
execute(params[:tag_name], params[:ref], params[:message], params[:release_description])
result = Tags::CreateService.new(@project, current_user)
.execute(params[:tag_name], params[:ref], params[:message], params[:release_description])
 
if result[:status] == :success
@tag = result[:tag]
Loading
Loading
Loading
Loading
@@ -128,8 +128,8 @@ class SessionsController < Devise::SessionsController
end
 
def log_audit_event(user, options = {})
AuditEventService.new(user, user, options).
for_authentication.security_event
AuditEventService.new(user, user, options)
.for_authentication.security_event
end
 
def log_user_activity(user)
Loading
Loading
Loading
Loading
@@ -4,8 +4,8 @@ module Sherlock
 
def find_transaction
if params[:transaction_id]
@transaction = Gitlab::Sherlock.collection.
find_transaction(params[:transaction_id])
@transaction = Gitlab::Sherlock.collection
.find_transaction(params[:transaction_id])
end
end
end
Loading
Loading
Loading
Loading
@@ -106,11 +106,11 @@ class UsersController < ApplicationController
 
def load_events
# Get user activity feed for projects common for both users
@events = user.recent_events.
merge(projects_for_current_user).
references(:project).
with_associations.
limit_recent(20, params[:offset])
@events = user.recent_events
.merge(projects_for_current_user)
.references(:project)
.with_associations
.limit_recent(20, params[:offset])
end
 
def load_projects
Loading
Loading
Loading
Loading
@@ -33,8 +33,8 @@ class EventsFinder
private
 
def by_current_user_access(events)
events.merge(ProjectsFinder.new(current_user: current_user).execute).
joins(:project)
events.merge(ProjectsFinder.new(current_user: current_user).execute)
.joins(:project)
end
 
def by_action(events)
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