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
Tatuya Kamada
gitlab-ce
Commits
ccbebbdf
Commit
ccbebbdf
authored
Feb 21, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Performance/RedundantMatch
parent
215228b4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
8 additions
and
15 deletions
+8
-15
.rubocop.yml
.rubocop.yml
+3
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-10
app/models/external_issue.rb
app/models/external_issue.rb
+1
-1
lib/ci/api/helpers.rb
lib/ci/api/helpers.rb
+1
-1
lib/extracts_path.rb
lib/extracts_path.rb
+1
-1
lib/gitlab/diff/highlight.rb
lib/gitlab/diff/highlight.rb
+1
-1
lib/gitlab/diff/parser.rb
lib/gitlab/diff/parser.rb
+1
-1
No files found.
.rubocop.yml
View file @
ccbebbdf
...
@@ -926,6 +926,9 @@ Lint/UnusedBlockArgument:
...
@@ -926,6 +926,9 @@ Lint/UnusedBlockArgument:
Performance/RedundantBlockCall
:
Performance/RedundantBlockCall
:
Enabled
:
true
Enabled
:
true
Performance/RedundantMatch
:
Enabled
:
true
Rails/HttpPositionalArguments
:
Rails/HttpPositionalArguments
:
Enabled
:
false
Enabled
:
false
...
...
.rubocop_todo.yml
View file @
ccbebbdf
...
@@ -6,16 +6,6 @@
...
@@ -6,16 +6,6 @@
# Note that changes in the inspected code, or installation of new
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# versions of RuboCop, may require this file to be generated again.
# Offense count: 5
# Cop supports --auto-correct.
Performance/RedundantMatch
:
Exclude
:
-
'
app/models/external_issue.rb'
-
'
lib/ci/api/helpers.rb'
-
'
lib/extracts_path.rb'
-
'
lib/gitlab/diff/highlight.rb'
-
'
lib/gitlab/diff/parser.rb'
# Offense count: 15
# Offense count: 15
# Configuration parameters: CustomIncludeMethods.
# Configuration parameters: CustomIncludeMethods.
RSpec/EmptyExampleGroup
:
RSpec/EmptyExampleGroup
:
...
...
app/models/external_issue.rb
View file @
ccbebbdf
...
@@ -43,7 +43,7 @@ class ExternalIssue
...
@@ -43,7 +43,7 @@ class ExternalIssue
end
end
def
reference_link_text
(
from_project
=
nil
)
def
reference_link_text
(
from_project
=
nil
)
return
"#
#{
id
}
"
if
/^\d+$/
.
match
(
id
)
return
"#
#{
id
}
"
if
id
=~
/^\d+$/
id
id
end
end
...
...
lib/ci/api/helpers.rb
View file @
ccbebbdf
...
@@ -60,7 +60,7 @@ module Ci
...
@@ -60,7 +60,7 @@ module Ci
end
end
def
build_not_found!
def
build_not_found!
if
headers
[
'User-Agent'
].
to_s
.
match
(
/gitlab-ci-multi-runner \d+\.\d+\.\d+(~beta\.\d+\.g[0-9a-f]+)? /
)
if
headers
[
'User-Agent'
].
to_s
=~
/gitlab-ci-multi-runner \d+\.\d+\.\d+(~beta\.\d+\.g[0-9a-f]+)? /
no_content!
no_content!
else
else
not_found!
not_found!
...
...
lib/extracts_path.rb
View file @
ccbebbdf
...
@@ -42,7 +42,7 @@ module ExtractsPath
...
@@ -42,7 +42,7 @@ module ExtractsPath
return
pair
unless
@project
return
pair
unless
@project
if
id
.
match
(
/^([[:alnum:]]{40})(.+)/
)
if
id
=~
/^([[:alnum:]]{40})(.+)/
# If the ref appears to be a SHA, we're done, just split the string
# If the ref appears to be a SHA, we're done, just split the string
pair
=
$~
.
captures
pair
=
$~
.
captures
else
else
...
...
lib/gitlab/diff/highlight.rb
View file @
ccbebbdf
...
@@ -50,7 +50,7 @@ module Gitlab
...
@@ -50,7 +50,7 @@ module Gitlab
# Only update text if line is found. This will prevent
# Only update text if line is found. This will prevent
# issues with submodules given the line only exists in diff content.
# issues with submodules given the line only exists in diff content.
if
rich_line
if
rich_line
line_prefix
=
diff_line
.
text
.
match
(
/\A(.)/
)
?
$1
:
' '
line_prefix
=
diff_line
.
text
=~
/\A(.)/
?
$1
:
' '
"
#{
line_prefix
}#{
rich_line
}
"
.
html_safe
"
#{
line_prefix
}#{
rich_line
}
"
.
html_safe
end
end
end
end
...
...
lib/gitlab/diff/parser.rb
View file @
ccbebbdf
...
@@ -20,7 +20,7 @@ module Gitlab
...
@@ -20,7 +20,7 @@ module Gitlab
full_line
=
line
.
delete
(
"
\n
"
)
full_line
=
line
.
delete
(
"
\n
"
)
if
line
.
match
(
/^@@ -/
)
if
line
=~
/^@@ -/
type
=
"match"
type
=
"match"
line_old
=
line
.
match
(
/\-[0-9]*/
)[
0
].
to_i
.
abs
rescue
0
line_old
=
line
.
match
(
/\-[0-9]*/
)[
0
].
to_i
.
abs
rescue
0
...
...
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