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
be14a73a
Commit
be14a73a
authored
Feb 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Performance/RedundantBlockCall
parent
8402a666
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
11 deletions
+6
-11
.rubocop.yml
.rubocop.yml
+3
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-8
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-1
lib/gitlab/optimistic_locking.rb
lib/gitlab/optimistic_locking.rb
+1
-1
lib/gitlab/shell.rb
lib/gitlab/shell.rb
+1
-1
No files found.
.rubocop.yml
View file @
be14a73a
...
...
@@ -923,6 +923,9 @@ Lint/UnneededSplatExpansion:
Lint/UnusedBlockArgument
:
Enabled
:
false
Performance/RedundantBlockCall
:
Enabled
:
true
Rails/HttpPositionalArguments
:
Enabled
:
false
...
...
.rubocop_todo.yml
View file @
be14a73a
...
...
@@ -6,14 +6,6 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 3
# Cop supports --auto-correct.
Performance/RedundantBlockCall
:
Exclude
:
-
'
app/controllers/application_controller.rb'
-
'
lib/gitlab/optimistic_locking.rb'
-
'
lib/gitlab/shell.rb'
# Offense count: 5
# Cop supports --auto-correct.
Performance/RedundantMatch
:
...
...
app/controllers/application_controller.rb
View file @
be14a73a
...
...
@@ -185,7 +185,7 @@ class ApplicationController < ActionController::Base
end
def
gitlab_ldap_access
(
&
block
)
Gitlab
::
LDAP
::
Access
.
open
{
|
access
|
block
.
call
(
access
)
}
Gitlab
::
LDAP
::
Access
.
open
{
|
access
|
yield
(
access
)
}
end
# JSON for infinite scroll via Pager object
...
...
lib/gitlab/optimistic_locking.rb
View file @
be14a73a
...
...
@@ -6,7 +6,7 @@ module Gitlab
loop
do
begin
ActiveRecord
::
Base
.
transaction
do
return
block
.
call
(
subject
)
return
yield
(
subject
)
end
rescue
ActiveRecord
::
StaleObjectError
retries
-=
1
...
...
lib/gitlab/shell.rb
View file @
be14a73a
...
...
@@ -206,7 +206,7 @@ module Gitlab
# batch_add_keys { |adder| adder.add_key("key-42", "sha-rsa ...") }
def
batch_add_keys
(
&
block
)
IO
.
popen
(
%W(
#{
gitlab_shell_path
}
/bin/gitlab-keys batch-add-keys)
,
'w'
)
do
|
io
|
block
.
call
(
KeyAdder
.
new
(
io
))
yield
(
KeyAdder
.
new
(
io
))
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