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
b399a354
Commit
b399a354
authored
Mar 29, 2022
by
Vitali Tatarintev
Committed by
Peter Leitzen
Apr 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Style/EachWithObject offenses
Fixes Style/EachWithObject offenses
parent
eb2022fe
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
5 additions
and
23 deletions
+5
-23
.rubocop_todo.yml
.rubocop_todo.yml
+0
-10
lib/expand_variables.rb
lib/expand_variables.rb
+1
-2
lib/gitlab/ci/ansi2html.rb
lib/gitlab/ci/ansi2html.rb
+1
-2
lib/gitlab/hook_data/issuable_builder.rb
lib/gitlab/hook_data/issuable_builder.rb
+1
-4
lib/gitlab/i18n/po_linter.rb
lib/gitlab/i18n/po_linter.rb
+1
-2
lib/gitlab/import_export/members_mapper.rb
lib/gitlab/import_export/members_mapper.rb
+1
-3
No files found.
.rubocop_todo.yml
View file @
b399a354
...
@@ -309,16 +309,6 @@ Style/BarePercentLiterals:
...
@@ -309,16 +309,6 @@ Style/BarePercentLiterals:
Style/CaseLikeIf
:
Style/CaseLikeIf
:
Enabled
:
false
Enabled
:
false
# Offense count: 5
# Cop supports --auto-correct.
Style/EachWithObject
:
Exclude
:
-
'
lib/expand_variables.rb'
-
'
lib/gitlab/ci/ansi2html.rb'
-
'
lib/gitlab/hook_data/issuable_builder.rb'
-
'
lib/gitlab/i18n/po_linter.rb'
-
'
lib/gitlab/import_export/members_mapper.rb'
# Offense count: 55
# Offense count: 55
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# Configuration parameters: EnforcedStyle.
...
...
lib/expand_variables.rb
View file @
b399a354
...
@@ -50,9 +50,8 @@ module ExpandVariables
...
@@ -50,9 +50,8 @@ module ExpandVariables
# Convert hash array to variables
# Convert hash array to variables
if
variables
.
is_a?
(
Array
)
if
variables
.
is_a?
(
Array
)
variables
=
variables
.
reduce
({})
do
|
hash
,
variable
|
variables
=
variables
.
each_with_object
({})
do
|
variable
,
hash
|
hash
[
variable
[
:key
]]
=
variable
[
:value
]
hash
[
variable
[
:key
]]
=
variable
[
:value
]
hash
end
end
end
end
...
...
lib/gitlab/ci/ansi2html.rb
View file @
b399a354
...
@@ -447,9 +447,8 @@ module Gitlab
...
@@ -447,9 +447,8 @@ module Gitlab
end
end
def
state
def
state
state
=
STATE_PARAMS
.
inject
({})
do
|
h
,
param
|
state
=
STATE_PARAMS
.
each_with_object
({})
do
|
param
,
h
|
h
[
param
]
=
send
(
param
)
# rubocop:disable GitlabSecurity/PublicSend
h
[
param
]
=
send
(
param
)
# rubocop:disable GitlabSecurity/PublicSend
h
end
end
Base64
.
urlsafe_encode64
(
state
.
to_json
)
Base64
.
urlsafe_encode64
(
state
.
to_json
)
end
end
...
...
lib/gitlab/hook_data/issuable_builder.rb
View file @
b399a354
...
@@ -53,10 +53,7 @@ module Gitlab
...
@@ -53,10 +53,7 @@ module Gitlab
end
end
def
final_changes
(
changes_hash
)
def
final_changes
(
changes_hash
)
changes_hash
.
reduce
({})
do
|
hash
,
(
key
,
changes_array
)
|
changes_hash
.
transform_values
{
|
changes_array
|
Hash
[
CHANGES_KEYS
.
zip
(
changes_array
)]
}
hash
[
key
]
=
Hash
[
CHANGES_KEYS
.
zip
(
changes_array
)]
hash
end
end
end
end
end
end
end
...
...
lib/gitlab/i18n/po_linter.rb
View file @
b399a354
...
@@ -248,10 +248,9 @@ module Gitlab
...
@@ -248,10 +248,9 @@ module Gitlab
variable
==
'%d'
?
Random
.
rand
(
1000
)
:
Gitlab
::
Utils
.
random_string
variable
==
'%d'
?
Random
.
rand
(
1000
)
:
Gitlab
::
Utils
.
random_string
end
end
else
else
variables
.
inject
({})
do
|
hash
,
variable
|
variables
.
each_with_object
({})
do
|
variable
,
hash
|
variable_name
=
variable
[
/\w+/
]
variable_name
=
variable
[
/\w+/
]
hash
[
variable_name
]
=
Gitlab
::
Utils
.
random_string
hash
[
variable_name
]
=
Gitlab
::
Utils
.
random_string
hash
end
end
end
end
end
end
...
...
lib/gitlab/import_export/members_mapper.rb
View file @
b399a354
...
@@ -16,7 +16,7 @@ module Gitlab
...
@@ -16,7 +16,7 @@ module Gitlab
def
map
def
map
@map
||=
@map
||=
begin
begin
@exported_members
.
inject
(
missing_keys_tracking_hash
)
do
|
hash
,
member
|
@exported_members
.
each_with_object
(
missing_keys_tracking_hash
)
do
|
member
,
hash
|
if
member
[
'user'
]
if
member
[
'user'
]
old_user_id
=
member
[
'user'
][
'id'
]
old_user_id
=
member
[
'user'
][
'id'
]
existing_user_id
=
existing_users_email_map
[
get_email
(
member
)]
existing_user_id
=
existing_users_email_map
[
get_email
(
member
)]
...
@@ -24,8 +24,6 @@ module Gitlab
...
@@ -24,8 +24,6 @@ module Gitlab
else
else
add_team_member
(
member
)
add_team_member
(
member
)
end
end
hash
end
end
end
end
end
end
...
...
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