Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f320219a
Commit
f320219a
authored
Jan 22, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rubocop offenses for cops with 1 or 2 offenses
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ab78d4b1
Changes
31
Show whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
42 additions
and
172 deletions
+42
-172
.rubocop_todo.yml
.rubocop_todo.yml
+1
-123
app/mailers/abuse_report_mailer.rb
app/mailers/abuse_report_mailer.rb
+1
-1
app/mailers/application_mailer.rb
app/mailers/application_mailer.rb
+1
-1
app/mailers/email_rejection_mailer.rb
app/mailers/email_rejection_mailer.rb
+1
-1
app/mailers/notify.rb
app/mailers/notify.rb
+1
-1
app/mailers/repository_check_mailer.rb
app/mailers/repository_check_mailer.rb
+1
-1
app/models/application_setting.rb
app/models/application_setting.rb
+1
-1
app/models/concerns/relative_positioning.rb
app/models/concerns/relative_positioning.rb
+1
-2
app/models/concerns/resolvable_discussion.rb
app/models/concerns/resolvable_discussion.rb
+1
-1
app/models/uploads/base.rb
app/models/uploads/base.rb
+1
-1
config/initializers/rspec_profiling.rb
config/initializers/rspec_profiling.rb
+1
-1
ee/app/mailers/ci_minutes_usage_mailer.rb
ee/app/mailers/ci_minutes_usage_mailer.rb
+1
-1
ee/spec/mailers/emails/service_desk_spec.rb
ee/spec/mailers/emails/service_desk_spec.rb
+1
-1
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+1
-1
lib/api/commit_statuses.rb
lib/api/commit_statuses.rb
+6
-8
lib/backup/manager.rb
lib/backup/manager.rb
+3
-3
lib/gitlab/ci/ansi2html.rb
lib/gitlab/ci/ansi2html.rb
+1
-1
lib/gitlab/cycle_analytics/usage_data.rb
lib/gitlab/cycle_analytics/usage_data.rb
+1
-1
lib/gitlab/git/diff_collection.rb
lib/gitlab/git/diff_collection.rb
+1
-1
lib/gitlab/gpg/commit.rb
lib/gitlab/gpg/commit.rb
+2
-2
lib/gitlab/highlight.rb
lib/gitlab/highlight.rb
+1
-1
lib/gitlab/project_search_results.rb
lib/gitlab/project_search_results.rb
+3
-3
lib/gitlab/project_transfer.rb
lib/gitlab/project_transfer.rb
+1
-1
lib/gitlab/template/base_template.rb
lib/gitlab/template/base_template.rb
+1
-1
lib/system_check/helpers.rb
lib/system_check/helpers.rb
+1
-5
lib/tasks/yarn.rake
lib/tasks/yarn.rake
+1
-0
qa/qa.rb
qa/qa.rb
+1
-1
spec/features/admin/admin_groups_spec.rb
spec/features/admin/admin_groups_spec.rb
+1
-1
spec/lib/gitlab/metrics/dashboard/processor_spec.rb
spec/lib/gitlab/metrics/dashboard/processor_spec.rb
+1
-1
spec/lib/marginalia_spec.rb
spec/lib/marginalia_spec.rb
+1
-1
spec/services/merge_requests/create_from_issue_service_spec.rb
...services/merge_requests/create_from_issue_service_spec.rb
+2
-4
No files found.
.rubocop_todo.yml
View file @
f320219a
...
@@ -52,14 +52,6 @@ Layout/ClosingParenthesisIndentation:
...
@@ -52,14 +52,6 @@ Layout/ClosingParenthesisIndentation:
-
'
spec/support/helpers/stub_object_storage.rb'
-
'
spec/support/helpers/stub_object_storage.rb'
-
'
spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb'
-
'
spec/workers/remove_unreferenced_lfs_objects_worker_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: leading, trailing
Layout/DotPosition
:
Exclude
:
-
'
app/models/concerns/relative_positioning.rb'
# Offense count: 69
# Offense count: 69
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Layout/EmptyLinesAroundArguments
:
Layout/EmptyLinesAroundArguments
:
...
@@ -100,12 +92,6 @@ Layout/IndentFirstParameter:
...
@@ -100,12 +92,6 @@ Layout/IndentFirstParameter:
-
'
spec/support/helpers/repo_helpers.rb'
-
'
spec/support/helpers/repo_helpers.rb'
-
'
spec/support/helpers/stub_object_storage.rb'
-
'
spec/support/helpers/stub_object_storage.rb'
# Offense count: 1
# Cop supports --auto-correct.
Layout/LeadingBlankLines
:
Exclude
:
-
'
lib/tasks/yarn.rake'
# Offense count: 54
# Offense count: 54
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, IndentationWidth.
# Configuration parameters: EnforcedStyle, IndentationWidth.
...
@@ -150,11 +136,6 @@ Layout/SpaceInsideBlockBraces:
...
@@ -150,11 +136,6 @@ Layout/SpaceInsideBlockBraces:
Layout/SpaceInsideParens
:
Layout/SpaceInsideParens
:
Enabled
:
false
Enabled
:
false
# Offense count: 1
Lint/DisjunctiveAssignmentInConstructor
:
Exclude
:
-
'
app/models/uploads/base.rb'
# Offense count: 19
# Offense count: 19
Lint/DuplicateMethods
:
Lint/DuplicateMethods
:
Exclude
:
Exclude
:
...
@@ -177,21 +158,6 @@ Lint/DuplicateMethods:
...
@@ -177,21 +158,6 @@ Lint/DuplicateMethods:
Lint/MissingCopEnableDirective
:
Lint/MissingCopEnableDirective
:
Enabled
:
false
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: Whitelist.
# Whitelist: present?, blank?, presence, try, try!
Lint/SafeNavigationConsistency
:
Exclude
:
-
'
lib/gitlab/gpg/commit.rb'
# Offense count: 2
# Cop supports --auto-correct.
Lint/ToJSON
:
Exclude
:
-
'
lib/gitlab/cycle_analytics/usage_data.rb'
-
'
lib/gitlab/template/base_template.rb'
# Offense count: 6
# Offense count: 6
Lint/UriEscapeUnescape
:
Lint/UriEscapeUnescape
:
Exclude
:
Exclude
:
...
@@ -200,12 +166,6 @@ Lint/UriEscapeUnescape:
...
@@ -200,12 +166,6 @@ Lint/UriEscapeUnescape:
-
'
spec/lib/google_api/auth_spec.rb'
-
'
spec/lib/google_api/auth_spec.rb'
-
'
spec/requests/api/files_spec.rb'
-
'
spec/requests/api/files_spec.rb'
# Offense count: 1
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void
:
Exclude
:
-
'
lib/gitlab/git/diff_collection.rb'
# Offense count: 165
# Offense count: 165
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
...
@@ -284,12 +244,6 @@ RSpec/LetBeforeExamples:
...
@@ -284,12 +244,6 @@ RSpec/LetBeforeExamples:
-
'
spec/rubocop/cop/migration/update_column_in_batches_spec.rb'
-
'
spec/rubocop/cop/migration/update_column_in_batches_spec.rb'
-
'
spec/serializers/pipeline_details_entity_spec.rb'
-
'
spec/serializers/pipeline_details_entity_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
RSpec/MultipleSubjects
:
Exclude
:
-
'
spec/services/merge_requests/create_from_issue_service_spec.rb'
# Offense count: 2018
# Offense count: 2018
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
# Configuration parameters: Strict, EnforcedStyle, AllowedExplicitMatchers.
...
@@ -319,12 +273,6 @@ RSpec/ScatteredSetup:
...
@@ -319,12 +273,6 @@ RSpec/ScatteredSetup:
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/requests/api/jobs_spec.rb'
-
'
spec/services/projects/create_service_spec.rb'
-
'
spec/services/projects/create_service_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
RSpec/SharedContext
:
Exclude
:
-
'
spec/features/admin/admin_groups_spec.rb'
# Offense count: 4
# Offense count: 4
RSpec/VoidExpect
:
RSpec/VoidExpect
:
Exclude
:
Exclude
:
...
@@ -348,12 +296,6 @@ Rails/ApplicationController:
...
@@ -348,12 +296,6 @@ Rails/ApplicationController:
-
'
spec/controllers/concerns/continue_params_spec.rb'
-
'
spec/controllers/concerns/continue_params_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
-
'
spec/lib/marginalia_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Rails/ApplicationMailer
:
Exclude
:
-
'
app/mailers/base_mailer.rb'
# Offense count: 8
# Offense count: 8
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Rails/BelongsTo
:
Rails/BelongsTo
:
...
@@ -414,14 +356,6 @@ Rails/LinkToBlank:
...
@@ -414,14 +356,6 @@ Rails/LinkToBlank:
Rails/RakeEnvironment
:
Rails/RakeEnvironment
:
Enabled
:
false
Enabled
:
false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include.
# Include: app/models/**/*.rb
Rails/RedundantAllowNil
:
Exclude
:
-
'
app/models/application_setting.rb'
# Offense count: 868
# Offense count: 868
# Configuration parameters: Blacklist, Whitelist.
# Configuration parameters: Blacklist, Whitelist.
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
...
@@ -457,12 +391,6 @@ Style/CommentedKeyword:
...
@@ -457,12 +391,6 @@ Style/CommentedKeyword:
-
'
lib/tasks/gitlab/backup.rake'
-
'
lib/tasks/gitlab/backup.rake'
-
'
spec/tasks/gitlab/backup_rake_spec.rb'
-
'
spec/tasks/gitlab/backup_rake_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/Dir
:
Exclude
:
-
'
qa/qa.rb'
# Offense count: 6
# Offense count: 6
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Style/EachWithObject
:
Style/EachWithObject
:
...
@@ -591,13 +519,6 @@ Style/NumericLiteralPrefix:
...
@@ -591,13 +519,6 @@ Style/NumericLiteralPrefix:
Style/NumericPredicate
:
Style/NumericPredicate
:
Enabled
:
false
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
Style/OrAssignment
:
Exclude
:
-
'
lib/api/commit_statuses.rb'
-
'
lib/gitlab/project_transfer.rb'
# Offense count: 106
# Offense count: 106
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Style/ParallelAssignment
:
Style/ParallelAssignment
:
...
@@ -632,12 +553,6 @@ Style/PerlBackrefs:
...
@@ -632,12 +553,6 @@ Style/PerlBackrefs:
Style/RaiseArgs
:
Style/RaiseArgs
:
Enabled
:
false
Enabled
:
false
# Offense count: 1
# Cop supports --auto-correct.
Style/RedundantConditional
:
Exclude
:
-
'
lib/system_check/helpers.rb'
# Offense count: 221
# Offense count: 221
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Style/RedundantFreeze
:
Style/RedundantFreeze
:
...
@@ -704,12 +619,6 @@ Style/SingleLineMethods:
...
@@ -704,12 +619,6 @@ Style/SingleLineMethods:
Style/SpecialGlobalVars
:
Style/SpecialGlobalVars
:
EnforcedStyle
:
use_perl_names
EnforcedStyle
:
use_perl_names
# Offense count: 1
# Cop supports --auto-correct.
Style/StderrPuts
:
Exclude
:
-
'
config/initializers/rspec_profiling.rb'
# Offense count: 75
# Offense count: 75
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# Configuration parameters: EnforcedStyle.
...
@@ -736,30 +645,6 @@ Style/TernaryParentheses:
...
@@ -736,30 +645,6 @@ Style/TernaryParentheses:
-
'
spec/requests/api/pipeline_schedules_spec.rb'
-
'
spec/requests/api/pipeline_schedules_spec.rb'
-
'
spec/support/capybara.rb'
-
'
spec/support/capybara.rb'
# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInArrayLiteral
:
Exclude
:
-
'
ee/spec/models/project_spec.rb'
-
'
spec/lib/gitlab/metrics/dashboard/processor_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyleForMultiline.
# SupportedStylesForMultiline: comma, consistent_comma, no_comma
Style/TrailingCommaInHashLiteral
:
Exclude
:
-
'
lib/gitlab/ci/ansi2html.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/UnlessElse
:
Exclude
:
-
'
lib/backup/manager.rb'
-
'
lib/gitlab/project_search_results.rb'
# Offense count: 8
# Offense count: 8
# Cop supports --auto-correct.
# Cop supports --auto-correct.
Style/UnneededCondition
:
Style/UnneededCondition
:
...
@@ -776,13 +661,6 @@ Style/UnneededCondition:
...
@@ -776,13 +661,6 @@ Style/UnneededCondition:
Style/UnneededInterpolation
:
Style/UnneededInterpolation
:
Enabled
:
false
Enabled
:
false
# Offense count: 2
# Cop supports --auto-correct.
Style/UnneededSort
:
Exclude
:
-
'
app/models/concerns/resolvable_discussion.rb'
-
'
lib/gitlab/highlight.rb'
RSpec/ReceiveCounts
:
RSpec/ReceiveCounts
:
Exclude
:
Exclude
:
-
'
ee/spec/models/broadcast_message_spec.rb'
-
'
ee/spec/models/broadcast_message_spec.rb'
...
...
app/mailers/abuse_report_mailer.rb
View file @
f320219a
# frozen_string_literal: true
# frozen_string_literal: true
class
AbuseReportMailer
<
Base
Mailer
class
AbuseReportMailer
<
Application
Mailer
layout
'empty_mailer'
layout
'empty_mailer'
helper
EmailsHelper
helper
EmailsHelper
...
...
app/mailers/
base
_mailer.rb
→
app/mailers/
application
_mailer.rb
View file @
f320219a
# frozen_string_literal: true
# frozen_string_literal: true
class
Base
Mailer
<
ActionMailer
::
Base
class
Application
Mailer
<
ActionMailer
::
Base
around_action
:render_with_default_locale
around_action
:render_with_default_locale
helper
ApplicationHelper
helper
ApplicationHelper
...
...
app/mailers/email_rejection_mailer.rb
View file @
f320219a
# frozen_string_literal: true
# frozen_string_literal: true
class
EmailRejectionMailer
<
Base
Mailer
class
EmailRejectionMailer
<
Application
Mailer
layout
'empty_mailer'
layout
'empty_mailer'
helper
EmailsHelper
helper
EmailsHelper
...
...
app/mailers/notify.rb
View file @
f320219a
# frozen_string_literal: true
# frozen_string_literal: true
class
Notify
<
Base
Mailer
class
Notify
<
Application
Mailer
include
ActionDispatch
::
Routing
::
PolymorphicRoutes
include
ActionDispatch
::
Routing
::
PolymorphicRoutes
include
GitlabRoutingHelper
include
GitlabRoutingHelper
include
EmailsHelper
include
EmailsHelper
...
...
app/mailers/repository_check_mailer.rb
View file @
f320219a
# frozen_string_literal: true
# frozen_string_literal: true
class
RepositoryCheckMailer
<
Base
Mailer
class
RepositoryCheckMailer
<
Application
Mailer
# rubocop: disable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
layout
'empty_mailer'
layout
'empty_mailer'
...
...
app/models/application_setting.rb
View file @
f320219a
...
@@ -142,7 +142,7 @@ class ApplicationSetting < ApplicationRecord
...
@@ -142,7 +142,7 @@ class ApplicationSetting < ApplicationRecord
if: :auto_devops_enabled?
if: :auto_devops_enabled?
validates
:enabled_git_access_protocol
,
validates
:enabled_git_access_protocol
,
inclusion:
{
in:
%w(ssh http)
,
allow_blank:
true
,
allow_nil:
true
}
inclusion:
{
in:
%w(ssh http)
,
allow_blank:
true
}
validates
:domain_blacklist
,
validates
:domain_blacklist
,
presence:
{
message:
'Domain blacklist cannot be empty if Blacklist is enabled.'
},
presence:
{
message:
'Domain blacklist cannot be empty if Blacklist is enabled.'
},
...
...
app/models/concerns/relative_positioning.rb
View file @
f320219a
...
@@ -237,8 +237,7 @@ module RelativePositioning
...
@@ -237,8 +237,7 @@ module RelativePositioning
relation
relation
.
pluck
(
self
.
class
.
relative_positioning_parent_column
,
Arel
.
sql
(
"
#{
calculation
}
(relative_position) AS position"
))
.
pluck
(
self
.
class
.
relative_positioning_parent_column
,
Arel
.
sql
(
"
#{
calculation
}
(relative_position) AS position"
))
.
first
&
.
.
first
&
.
last
last
end
end
def
scoped_items
def
scoped_items
...
...
app/models/concerns/resolvable_discussion.rb
View file @
f320219a
...
@@ -63,7 +63,7 @@ module ResolvableDiscussion
...
@@ -63,7 +63,7 @@ module ResolvableDiscussion
return
unless
resolved?
return
unless
resolved?
strong_memoize
(
:last_resolved_note
)
do
strong_memoize
(
:last_resolved_note
)
do
resolved_notes
.
sort_by
(
&
:resolved_at
).
last
resolved_notes
.
max_by
(
&
:resolved_at
)
end
end
end
end
...
...
app/models/uploads/base.rb
View file @
f320219a
...
@@ -7,7 +7,7 @@ module Uploads
...
@@ -7,7 +7,7 @@ module Uploads
attr_reader
:logger
attr_reader
:logger
def
initialize
(
logger:
nil
)
def
initialize
(
logger:
nil
)
@logger
||
=
Rails
.
logger
# rubocop:disable Gitlab/RailsLogger
@logger
=
Rails
.
logger
# rubocop:disable Gitlab/RailsLogger
end
end
def
delete_keys_async
(
keys_to_delete
)
def
delete_keys_async
(
keys_to_delete
)
...
...
config/initializers/rspec_profiling.rb
View file @
f320219a
...
@@ -46,7 +46,7 @@ module RspecProfilingExt
...
@@ -46,7 +46,7 @@ module RspecProfilingExt
rescue
=>
err
rescue
=>
err
return
if
@already_logged_example_finished_error
# rubocop:disable Gitlab/ModuleWithInstanceVariables
return
if
@already_logged_example_finished_error
# rubocop:disable Gitlab/ModuleWithInstanceVariables
$stderr
.
puts
"rspec_profiling couldn't collect an example:
#{
err
}
. Further warnings suppressed."
warn
"rspec_profiling couldn't collect an example:
#{
err
}
. Further warnings suppressed."
@already_logged_example_finished_error
=
true
# rubocop:disable Gitlab/ModuleWithInstanceVariables
@already_logged_example_finished_error
=
true
# rubocop:disable Gitlab/ModuleWithInstanceVariables
end
end
...
...
ee/app/mailers/ci_minutes_usage_mailer.rb
View file @
f320219a
# frozen_string_literal: true
# frozen_string_literal: true
class
CiMinutesUsageMailer
<
Base
Mailer
class
CiMinutesUsageMailer
<
Application
Mailer
def
notify
(
namespace_name
,
recipients
)
def
notify
(
namespace_name
,
recipients
)
@namespace_name
=
namespace_name
@namespace_name
=
namespace_name
...
...
ee/spec/mailers/emails/service_desk_spec.rb
View file @
f320219a
...
@@ -15,7 +15,7 @@ describe Emails::ServiceDesk do
...
@@ -15,7 +15,7 @@ describe Emails::ServiceDesk do
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:template
)
{
double
(
content:
template_content
)
}
let
(
:template
)
{
double
(
content:
template_content
)
}
class
ServiceEmailClass
<
Base
Mailer
class
ServiceEmailClass
<
Application
Mailer
include
GitlabRoutingHelper
include
GitlabRoutingHelper
include
EmailsHelper
include
EmailsHelper
include
Emails
::
ServiceDesk
include
Emails
::
ServiceDesk
...
...
ee/spec/models/project_spec.rb
View file @
f320219a
...
@@ -1282,7 +1282,7 @@ describe Project do
...
@@ -1282,7 +1282,7 @@ describe Project do
:epics
,
# Gold only
:epics
,
# Gold only
:service_desk
,
# Silver and up
:service_desk
,
# Silver and up
:audit_events
,
# Bronze and up
:audit_events
,
# Bronze and up
:geo
,
# Global feature, should not be checked at namespace level
:geo
# Global feature, should not be checked at namespace level
])
])
end
end
...
...
lib/api/commit_statuses.rb
View file @
f320219a
...
@@ -76,14 +76,12 @@ module API
...
@@ -76,14 +76,12 @@ module API
name
=
params
[
:name
]
||
params
[
:context
]
||
'default'
name
=
params
[
:name
]
||
params
[
:context
]
||
'default'
unless
pipeline
pipeline
||=
user_project
.
ci_pipelines
.
create!
(
pipeline
=
user_project
.
ci_pipelines
.
create!
(
source: :external
,
source: :external
,
sha:
commit
.
sha
,
sha:
commit
.
sha
,
ref:
ref
,
ref:
ref
,
user:
current_user
,
user:
current_user
,
protected:
user_project
.
protected_for?
(
ref
))
protected:
user_project
.
protected_for?
(
ref
))
end
status
=
GenericCommitStatus
.
running_or_pending
.
find_or_initialize_by
(
status
=
GenericCommitStatus
.
running_or_pending
.
find_or_initialize_by
(
project:
user_project
,
project:
user_project
,
...
...
lib/backup/manager.rb
View file @
f320219a
...
@@ -135,11 +135,11 @@ module Backup
...
@@ -135,11 +135,11 @@ module Backup
progress
.
print
'Unpacking backup ... '
progress
.
print
'Unpacking backup ... '
unless
Kernel
.
system
(
*
%W(tar -xf
#{
tar_file
}
)
)
if
Kernel
.
system
(
*
%W(tar -xf
#{
tar_file
}
)
)
progress
.
puts
'done'
.
color
(
:green
)
else
progress
.
puts
'unpacking backup failed'
.
color
(
:red
)
progress
.
puts
'unpacking backup failed'
.
color
(
:red
)
exit
1
exit
1
else
progress
.
puts
'done'
.
color
(
:green
)
end
end
ENV
[
"VERSION"
]
=
"
#{
settings
[
:db_version
]
}
"
if
settings
[
:db_version
].
to_i
>
0
ENV
[
"VERSION"
]
=
"
#{
settings
[
:db_version
]
}
"
if
settings
[
:db_version
].
to_i
>
0
...
...
lib/gitlab/ci/ansi2html.rb
View file @
f320219a
...
@@ -15,7 +15,7 @@ module Gitlab
...
@@ -15,7 +15,7 @@ module Gitlab
4
=>
'blue'
,
4
=>
'blue'
,
5
=>
'magenta'
,
5
=>
'magenta'
,
6
=>
'cyan'
,
6
=>
'cyan'
,
7
=>
'white'
,
# not that this is gray in the dark (aka default) color table
7
=>
'white'
# not that this is gray in the dark (aka default) color table
}.
freeze
}.
freeze
STYLE_SWITCHES
=
{
STYLE_SWITCHES
=
{
...
...
lib/gitlab/cycle_analytics/usage_data.rb
View file @
f320219a
...
@@ -12,7 +12,7 @@ module Gitlab
...
@@ -12,7 +12,7 @@ module Gitlab
@options
=
{
from:
7
.
days
.
ago
}
@options
=
{
from:
7
.
days
.
ago
}
end
end
def
to_json
def
to_json
(
*
)
total
=
0
total
=
0
values
=
values
=
...
...
lib/gitlab/git/diff_collection.rb
View file @
f320219a
...
@@ -102,7 +102,7 @@ module Gitlab
...
@@ -102,7 +102,7 @@ module Gitlab
def
populate!
def
populate!
return
if
@populated
return
if
@populated
each
{
nil
}
# force a loop through all diffs
each
{}
# force a loop through all diffs
nil
nil
end
end
...
...
lib/gitlab/gpg/commit.rb
View file @
f320219a
...
@@ -16,13 +16,13 @@ module Gitlab
...
@@ -16,13 +16,13 @@ module Gitlab
def
signature_text
def
signature_text
strong_memoize
(
:signature_text
)
do
strong_memoize
(
:signature_text
)
do
@signature_data
&
.
itself
&&
@signature_data
[
0
]
@signature_data
&
.
itself
&&
@signature_data
[
0
]
# rubocop:disable Lint/SafeNavigationConsistency
end
end
end
end
def
signed_text
def
signed_text
strong_memoize
(
:signed_text
)
do
strong_memoize
(
:signed_text
)
do
@signature_data
&
.
itself
&&
@signature_data
[
1
]
@signature_data
&
.
itself
&&
@signature_data
[
1
]
# rubocop:disable Lint/SafeNavigationConsistency
end
end
end
end
...
...
lib/gitlab/highlight.rb
View file @
f320219a
...
@@ -32,7 +32,7 @@ module Gitlab
...
@@ -32,7 +32,7 @@ module Gitlab
@lexer
||=
custom_language
||
begin
@lexer
||=
custom_language
||
begin
Rouge
::
Lexer
.
guess
(
filename:
@blob_name
,
source:
@blob_content
).
new
Rouge
::
Lexer
.
guess
(
filename:
@blob_name
,
source:
@blob_content
).
new
rescue
Rouge
::
Guesser
::
Ambiguous
=>
e
rescue
Rouge
::
Guesser
::
Ambiguous
=>
e
e
.
alternatives
.
sort_by
(
&
:tag
).
first
e
.
alternatives
.
min_by
(
&
:tag
)
end
end
end
end
...
...
lib/gitlab/project_search_results.rb
View file @
f320219a
...
@@ -106,10 +106,10 @@ module Gitlab
...
@@ -106,10 +106,10 @@ module Gitlab
@wiki_blobs
||=
begin
@wiki_blobs
||=
begin
if
project
.
wiki_enabled?
&&
query
.
present?
if
project
.
wiki_enabled?
&&
query
.
present?
unless
project
.
wiki
.
empty?
if
project
.
wiki
.
empty?
Gitlab
::
WikiFileFinder
.
new
(
project
,
repository_wiki_ref
).
find
(
query
)
else
[]
[]
else
Gitlab
::
WikiFileFinder
.
new
(
project
,
repository_wiki_ref
).
find
(
query
)
end
end
else
else
[]
[]
...
...
lib/gitlab/project_transfer.rb
View file @
f320219a
...
@@ -32,7 +32,7 @@ module Gitlab
...
@@ -32,7 +32,7 @@ module Gitlab
private
private
def
move
(
path_was
,
path
,
base_dir
=
nil
)
def
move
(
path_was
,
path
,
base_dir
=
nil
)
base_dir
=
root_dir
unless
base
_dir
base_dir
||=
root
_dir
from
=
File
.
join
(
base_dir
,
path_was
)
from
=
File
.
join
(
base_dir
,
path_was
)
to
=
File
.
join
(
base_dir
,
path
)
to
=
File
.
join
(
base_dir
,
path
)
FileUtils
.
mv
(
from
,
to
)
FileUtils
.
mv
(
from
,
to
)
...
...
lib/gitlab/template/base_template.rb
View file @
f320219a
...
@@ -33,7 +33,7 @@ module Gitlab
...
@@ -33,7 +33,7 @@ module Gitlab
self
self
end
end
def
to_json
def
to_json
(
*
)
{
key:
key
,
name:
name
,
content:
content
}
{
key:
key
,
name:
name
,
content:
content
}
end
end
...
...
lib/system_check/helpers.rb
View file @
f320219a
...
@@ -57,11 +57,7 @@ module SystemCheck
...
@@ -57,11 +57,7 @@ module SystemCheck
end
end
def
should_sanitize?
def
should_sanitize?
if
ENV
[
'SANITIZE'
]
==
'true'
ENV
[
'SANITIZE'
]
==
'true'
true
else
false
end
end
end
def
omnibus_gitlab?
def
omnibus_gitlab?
...
...
lib/tasks/yarn.rake
View file @
f320219a
# frozen_string_literal: true
namespace
:yarn
do
namespace
:yarn
do
desc
'Ensure Yarn is installed'
desc
'Ensure Yarn is installed'
...
...
qa/qa.rb
View file @
f320219a
# frozen_string_literal: true
# frozen_string_literal: true
$:
<<
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
)
$:
<<
File
.
expand_path
(
__dir__
)
Encoding
.
default_external
=
'UTF-8'
Encoding
.
default_external
=
'UTF-8'
...
...
spec/features/admin/admin_groups_spec.rb
View file @
f320219a
...
@@ -134,7 +134,7 @@ describe 'Admin Groups' do
...
@@ -134,7 +134,7 @@ describe 'Admin Groups' do
end
end
describe
'add user into a group'
,
:js
do
describe
'add user into a group'
,
:js
do
shared_
context
'adds user into a group'
do
shared_
examples
'adds user into a group'
do
it
do
it
do
visit
admin_group_path
(
group
)
visit
admin_group_path
(
group
)
...
...
spec/lib/gitlab/metrics/dashboard/processor_spec.rb
View file @
f320219a
...
@@ -62,7 +62,7 @@ describe Gitlab::Metrics::Dashboard::Processor do
...
@@ -62,7 +62,7 @@ describe Gitlab::Metrics::Dashboard::Processor do
'metric_a1'
,
# group priority 1, panel weight 1
'metric_a1'
,
# group priority 1, panel weight 1
project_business_metric
.
id
,
# group priority 0, panel weight nil (0)
project_business_metric
.
id
,
# group priority 0, panel weight nil (0)
project_response_metric
.
id
,
# group priority -5, panel weight nil (0)
project_response_metric
.
id
,
# group priority -5, panel weight nil (0)
project_system_metric
.
id
,
# group priority -10, panel weight nil (0)
project_system_metric
.
id
# group priority -10, panel weight nil (0)
]
]
actual_metrics_order
=
all_metrics
.
map
{
|
m
|
m
[
:id
]
||
m
[
:metric_id
]
}
actual_metrics_order
=
all_metrics
.
map
{
|
m
|
m
[
:id
]
||
m
[
:metric_id
]
}
...
...
spec/lib/marginalia_spec.rb
View file @
f320219a
...
@@ -18,7 +18,7 @@ describe 'Marginalia spec' do
...
@@ -18,7 +18,7 @@ describe 'Marginalia spec' do
end
end
end
end
class
MarginaliaTestMailer
<
Base
Mailer
class
MarginaliaTestMailer
<
Application
Mailer
def
first_user
def
first_user
User
.
first
User
.
first
end
end
...
...
spec/services/merge_requests/create_from_issue_service_spec.rb
View file @
f320219a
...
@@ -11,10 +11,8 @@ describe MergeRequests::CreateFromIssueService do
...
@@ -11,10 +11,8 @@ describe MergeRequests::CreateFromIssueService do
let
(
:milestone_id
)
{
create
(
:milestone
,
project:
project
).
id
}
let
(
:milestone_id
)
{
create
(
:milestone
,
project:
project
).
id
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
milestone_id:
milestone_id
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
,
milestone_id:
milestone_id
)
}
let
(
:custom_source_branch
)
{
'custom-source-branch'
}
let
(
:custom_source_branch
)
{
'custom-source-branch'
}
let
(
:service
)
{
described_class
.
new
(
project
,
user
,
service_params
)
}
subject
(
:service
)
{
described_class
.
new
(
project
,
user
,
service_params
)
}
let
(
:service_with_custom_source_branch
)
{
described_class
.
new
(
project
,
user
,
branch_name:
custom_source_branch
,
**
service_params
)
}
subject
(
:service_with_custom_source_branch
)
{
described_class
.
new
(
project
,
user
,
branch_name:
custom_source_branch
,
**
service_params
)
}
before
do
before
do
project
.
add_developer
(
user
)
project
.
add_developer
(
user
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment