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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
4a191c83
Commit
4a191c83
authored
Oct 03, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Lint/StringConversionInInterpolation cop and autocorrect offenses
parent
dfb9cab8
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
13 additions
and
14 deletions
+13
-14
.rubocop.yml
.rubocop.yml
+4
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-5
app/controllers/concerns/spammable_actions.rb
app/controllers/concerns/spammable_actions.rb
+1
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+1
-1
app/models/commit_range.rb
app/models/commit_range.rb
+1
-1
app/services/system_hooks_service.rb
app/services/system_hooks_service.rb
+1
-1
app/services/system_note_service.rb
app/services/system_note_service.rb
+1
-1
spec/finders/access_requests_finder_spec.rb
spec/finders/access_requests_finder_spec.rb
+1
-1
spec/lib/gitlab/import_export/attribute_configuration_spec.rb
.../lib/gitlab/import_export/attribute_configuration_spec.rb
+1
-1
spec/services/members/approve_access_request_service_spec.rb
spec/services/members/approve_access_request_service_spec.rb
+1
-1
spec/services/members/request_access_service_spec.rb
spec/services/members/request_access_service_spec.rb
+1
-1
No files found.
.rubocop.yml
View file @
4a191c83
...
@@ -639,6 +639,10 @@ Lint/RescueException:
...
@@ -639,6 +639,10 @@ Lint/RescueException:
Lint/ShadowedException
:
Lint/ShadowedException
:
Enabled
:
false
Enabled
:
false
# Checks for Object#to_s usage in string interpolation.
Lint/StringConversionInInterpolation
:
Enabled
:
true
# Do not use prefix `_` for a variable that is used.
# Do not use prefix `_` for a variable that is used.
Lint/UnderscorePrefixedVariableName
:
Lint/UnderscorePrefixedVariableName
:
Enabled
:
true
Enabled
:
true
...
...
.rubocop_todo.yml
View file @
4a191c83
...
@@ -27,11 +27,6 @@ Lint/Loop:
...
@@ -27,11 +27,6 @@ Lint/Loop:
Lint/ShadowingOuterLocalVariable
:
Lint/ShadowingOuterLocalVariable
:
Enabled
:
false
Enabled
:
false
# Offense count: 6
# Cop supports --auto-correct.
Lint/StringConversionInInterpolation
:
Enabled
:
false
# Offense count: 49
# Offense count: 49
# Cop supports --auto-correct.
# Cop supports --auto-correct.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
...
...
app/controllers/concerns/spammable_actions.rb
View file @
4a191c83
...
@@ -7,7 +7,7 @@ module SpammableActions
...
@@ -7,7 +7,7 @@ module SpammableActions
def
mark_as_spam
def
mark_as_spam
if
SpamService
.
new
(
spammable
).
mark_as_spam!
if
SpamService
.
new
(
spammable
).
mark_as_spam!
redirect_to
spammable
,
notice:
"
#{
spammable
.
class
.
to_s
}
was submitted to Akismet successfully."
redirect_to
spammable
,
notice:
"
#{
spammable
.
class
}
was submitted to Akismet successfully."
else
else
redirect_to
spammable
,
alert:
'Error with Akismet. Please check the logs for more info.'
redirect_to
spammable
,
alert:
'Error with Akismet. Please check the logs for more info.'
end
end
...
...
app/helpers/projects_helper.rb
View file @
4a191c83
...
@@ -139,7 +139,7 @@ module ProjectsHelper
...
@@ -139,7 +139,7 @@ module ProjectsHelper
end
end
options
=
options_for_select
(
options
,
selected:
highest_available_option
||
@project
.
project_feature
.
public_send
(
field
))
options
=
options_for_select
(
options
,
selected:
highest_available_option
||
@project
.
project_feature
.
public_send
(
field
))
content_tag
(
:select
,
options
,
name:
"project[project_feature_attributes][
#{
field
.
to_s
}
]"
,
id:
"project_project_feature_attributes_
#{
field
.
to_s
}
"
,
class:
"pull-right form-control"
,
data:
{
field:
field
}).
html_safe
content_tag
(
:select
,
options
,
name:
"project[project_feature_attributes][
#{
field
}
]"
,
id:
"project_project_feature_attributes_
#{
field
}
"
,
class:
"pull-right form-control"
,
data:
{
field:
field
}).
html_safe
end
end
private
private
...
...
app/models/commit_range.rb
View file @
4a191c83
...
@@ -80,7 +80,7 @@ class CommitRange
...
@@ -80,7 +80,7 @@ class CommitRange
end
end
def
inspect
def
inspect
%(#<#{self.class}:#{object_id} #{
to_s
}>)
%(#<#{self.class}:#{object_id} #{
self
}>)
end
end
def
to_s
def
to_s
...
...
app/services/system_hooks_service.rb
View file @
4a191c83
...
@@ -72,7 +72,7 @@ class SystemHooksService
...
@@ -72,7 +72,7 @@ class SystemHooksService
return
'user_add_to_group'
if
event
==
:create
return
'user_add_to_group'
if
event
==
:create
return
'user_remove_from_group'
if
event
==
:destroy
return
'user_remove_from_group'
if
event
==
:destroy
else
else
"
#{
model
.
class
.
name
.
downcase
}
_
#{
event
.
to_s
}
"
"
#{
model
.
class
.
name
.
downcase
}
_
#{
event
}
"
end
end
end
end
...
...
app/services/system_note_service.rb
View file @
4a191c83
...
@@ -246,7 +246,7 @@ module SystemNoteService
...
@@ -246,7 +246,7 @@ module SystemNoteService
'deleted'
'deleted'
end
end
body
=
"
#{
verb
}
#{
branch_type
.
to_s
}
branch `
#{
branch
}
`"
.
capitalize
body
=
"
#{
verb
}
#{
branch_type
}
branch `
#{
branch
}
`"
.
capitalize
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
create_note
(
noteable:
noteable
,
project:
project
,
author:
author
,
note:
body
)
end
end
...
...
spec/finders/access_requests_finder_spec.rb
View file @
4a191c83
...
@@ -16,7 +16,7 @@ describe AccessRequestsFinder, services: true do
...
@@ -16,7 +16,7 @@ describe AccessRequestsFinder, services: true do
access_requesters
=
described_class
.
new
(
source
).
public_send
(
method_name
,
user
)
access_requesters
=
described_class
.
new
(
source
).
public_send
(
method_name
,
user
)
expect
(
access_requesters
.
size
).
to
eq
(
1
)
expect
(
access_requesters
.
size
).
to
eq
(
1
)
expect
(
access_requesters
.
first
).
to
be_a
"
#{
source
.
class
.
to_s
}
Member"
.
constantize
expect
(
access_requesters
.
first
).
to
be_a
"
#{
source
.
class
}
Member"
.
constantize
expect
(
access_requesters
.
first
.
user
).
to
eq
(
access_requester
)
expect
(
access_requesters
.
first
.
user
).
to
eq
(
access_requester
)
end
end
end
end
...
...
spec/lib/gitlab/import_export/attribute_configuration_spec.rb
View file @
4a191c83
...
@@ -27,7 +27,7 @@ describe 'Import/Export attribute configuration', lib: true do
...
@@ -27,7 +27,7 @@ describe 'Import/Export attribute configuration', lib: true do
relation_names
.
each
do
|
relation_name
|
relation_names
.
each
do
|
relation_name
|
relation_class
=
relation_class_for_name
(
relation_name
)
relation_class
=
relation_class_for_name
(
relation_name
)
expect
(
safe_model_attributes
[
relation_class
.
to_s
]).
not_to
be_nil
,
"Expected exported class
#{
relation_class
.
to_s
}
to exist in safe_model_attributes"
expect
(
safe_model_attributes
[
relation_class
.
to_s
]).
not_to
be_nil
,
"Expected exported class
#{
relation_class
}
to exist in safe_model_attributes"
current_attributes
=
parsed_attributes
(
relation_name
,
relation_class
.
attribute_names
)
current_attributes
=
parsed_attributes
(
relation_name
,
relation_class
.
attribute_names
)
safe_attributes
=
safe_model_attributes
[
relation_class
.
to_s
]
safe_attributes
=
safe_model_attributes
[
relation_class
.
to_s
]
...
...
spec/services/members/approve_access_request_service_spec.rb
View file @
4a191c83
...
@@ -26,7 +26,7 @@ describe Members::ApproveAccessRequestService, services: true do
...
@@ -26,7 +26,7 @@ describe Members::ApproveAccessRequestService, services: true do
it
'returns a <Source>Member'
do
it
'returns a <Source>Member'
do
member
=
described_class
.
new
(
source
,
user
,
params
).
execute
member
=
described_class
.
new
(
source
,
user
,
params
).
execute
expect
(
member
).
to
be_a
"
#{
source
.
class
.
to_s
}
Member"
.
constantize
expect
(
member
).
to
be_a
"
#{
source
.
class
}
Member"
.
constantize
expect
(
member
.
requested_at
).
to
be_nil
expect
(
member
.
requested_at
).
to
be_nil
end
end
...
...
spec/services/members/request_access_service_spec.rb
View file @
4a191c83
...
@@ -19,7 +19,7 @@ describe Members::RequestAccessService, services: true do
...
@@ -19,7 +19,7 @@ describe Members::RequestAccessService, services: true do
it
'returns a <Source>Member'
do
it
'returns a <Source>Member'
do
member
=
described_class
.
new
(
source
,
user
).
execute
member
=
described_class
.
new
(
source
,
user
).
execute
expect
(
member
).
to
be_a
"
#{
source
.
class
.
to_s
}
Member"
.
constantize
expect
(
member
).
to
be_a
"
#{
source
.
class
}
Member"
.
constantize
expect
(
member
.
requested_at
).
to
be_present
expect
(
member
.
requested_at
).
to
be_present
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