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
f15faf3d
Commit
f15faf3d
authored
Jun 22, 2020
by
Peter Leitzen
Committed by
Dylan Griffith
Jun 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix todo offenses for Style/HashTransformKeys
parent
0e816c66
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
19 deletions
+7
-19
.rubocop_todo.yml
.rubocop_todo.yml
+0
-9
ee/app/models/vulnerabilities/occurrence.rb
ee/app/models/vulnerabilities/occurrence.rb
+2
-2
ee/spec/lib/gitlab/ci/templates/dependency_scanning_gitlab_ci_yaml_spec.rb
...b/ci/templates/dependency_scanning_gitlab_ci_yaml_spec.rb
+3
-3
lib/banzai/filter/commit_trailers_filter.rb
lib/banzai/filter/commit_trailers_filter.rb
+1
-4
lib/gitlab/analytics/cycle_analytics/stage_events.rb
lib/gitlab/analytics/cycle_analytics/stage_events.rb
+1
-1
No files found.
.rubocop_todo.yml
View file @
f15faf3d
...
...
@@ -560,15 +560,6 @@ Style/GuardClause:
Style/HashEachMethods
:
Enabled
:
false
# Offense count: 6
# Cop supports --auto-correct.
Style/HashTransformKeys
:
Exclude
:
-
'
ee/app/models/vulnerabilities/occurrence.rb'
-
'
ee/spec/lib/gitlab/ci/templates/dependency_scanning_gitlab_ci_yaml_spec.rb'
-
'
lib/banzai/filter/commit_trailers_filter.rb'
-
'
lib/gitlab/analytics/cycle_analytics/stage_events.rb'
# Offense count: 31
# Configuration parameters: AllowIfModifier.
Style/IfInsideElse
:
...
...
ee/app/models/vulnerabilities/occurrence.rb
View file @
f15faf3d
...
...
@@ -115,8 +115,8 @@ module Vulnerabilities
end
def
self
.
counted_by_severity
group
(
:severity
).
count
.
each_with_object
({})
do
|
(
severity
,
count
),
accum
|
accum
[
SEVERITY_LEVELS
[
severity
]]
=
count
group
(
:severity
).
count
.
transform_keys
do
|
severity
|
SEVERITY_LEVELS
[
severity
]
end
end
...
...
ee/spec/lib/gitlab/ci/templates/dependency_scanning_gitlab_ci_yaml_spec.rb
View file @
f15faf3d
...
...
@@ -91,7 +91,7 @@ RSpec.describe 'Dependency-Scanning.gitlab-ci.yml' do
context
'with file at depth 1'
do
# prepend a directory to files (e.g. convert go.sum to foo/go.sum)
let
(
:files_at_depth_x
)
{
Hash
[
files
.
map
{
|
k
,
v
|
[
"foo/
#{
k
}
"
,
v
]}]
}
let
(
:files_at_depth_x
)
{
files
.
transform_keys
{
|
k
|
"foo/
#{
k
}
"
}
}
it
'creates a pipeline with the expected jobs'
do
expect
(
build_names
).
to
include
(
*
include_build_names
)
...
...
@@ -100,7 +100,7 @@ RSpec.describe 'Dependency-Scanning.gitlab-ci.yml' do
context
'with file at depth 2'
do
# prepend a directory to files (e.g. convert go.sum to foo/bar/go.sum)
let
(
:files_at_depth_x
)
{
Hash
[
files
.
map
{
|
k
,
v
|
[
"foo/bar/
#{
k
}
"
,
v
]}]
}
let
(
:files_at_depth_x
)
{
files
.
transform_keys
{
|
k
|
"foo/bar/
#{
k
}
"
}
}
it
'creates a pipeline with the expected jobs'
do
expect
(
build_names
).
to
include
(
*
include_build_names
)
...
...
@@ -108,7 +108,7 @@ RSpec.describe 'Dependency-Scanning.gitlab-ci.yml' do
end
context
'with file at depth > 2'
do
let
(
:files_at_depth_x
)
{
Hash
[
files
.
map
{
|
k
,
v
|
[
"foo/bar/baz/
#{
k
}
"
,
v
]}]
}
let
(
:files_at_depth_x
)
{
files
.
transform_keys
{
|
k
|
"foo/bar/baz/
#{
k
}
"
}
}
it
'includes no job'
do
expect
{
pipeline
}.
to
raise_error
(
Ci
::
CreatePipelineService
::
CreateError
)
...
...
lib/banzai/filter/commit_trailers_filter.rb
View file @
f15faf3d
...
...
@@ -144,10 +144,7 @@ module Banzai
end
def
data_attributes_from_hash
(
data
=
{})
data
.
reject!
{
|
_
,
value
|
value
.
nil?
}
data
.
map
do
|
key
,
value
|
[
%(data-#{key.to_s.dasherize})
,
value
]
end
.
to_h
data
.
compact
.
transform_keys
{
|
key
|
%(data-#{key.to_s.dasherize})
}
end
end
end
...
...
lib/gitlab/analytics/cycle_analytics/stage_events.rb
View file @
f15faf3d
...
...
@@ -60,7 +60,7 @@ module Gitlab
# hash for defining ActiveRecord enum: identifier => number
def
self
.
to_enum
enum_mapping
.
each_with_object
({})
{
|
(
k
,
v
),
hash
|
hash
[
k
.
identifier
]
=
v
}
enum_mapping
.
transform_keys
{
|
k
|
k
.
identifier
}
end
def
self
.
pairing_rules
...
...
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