BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
07be5943
Commit
07be5943
authored
May 30, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Style/MultilineTernaryOperator rubocop cop
Avoid multi-line ?: (the ternary operator). Use if/unless instead. See #17478
parent
79b02e40
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
.rubocop.yml
.rubocop.yml
+4
-0
.rubocop_todo.yml
.rubocop_todo.yml
+0
-4
relative_link_filter.rb
lib/banzai/filter/relative_link_filter.rb
+1
-2
api_helpers.rb
spec/support/api_helpers.rb
+10
-4
No files found.
.rubocop.yml
View file @
07be5943
...
...
@@ -291,6 +291,10 @@ Style/MultilineMethodDefinitionBraceLayout:
Style/MultilineOperationIndentation
:
Enabled
:
false
# Avoid multi-line `? :` (the ternary operator), use if/unless instead.
Style/MultilineTernaryOperator
:
Enabled
:
true
# Favor unless over if for negative conditions (or control flow or).
Style/NegatedIf
:
Enabled
:
true
...
...
.rubocop_todo.yml
View file @
07be5943
...
...
@@ -226,10 +226,6 @@ Style/LineEndConcatenation:
Style/MethodCallParentheses
:
Enabled
:
false
# Offense count: 3
Style/MultilineTernaryOperator
:
Enabled
:
false
# Offense count: 62
# Cop supports --auto-correct.
Style/MutableConstant
:
...
...
lib/banzai/filter/relative_link_filter.rb
View file @
07be5943
...
...
@@ -112,8 +112,7 @@ module Banzai
end
def
current_commit
@current_commit
||=
context
[
:commit
]
||
ref
?
repository
.
commit
(
ref
)
:
repository
.
head_commit
@current_commit
||=
context
[
:commit
]
||
ref
?
repository
.
commit
(
ref
)
:
repository
.
head_commit
end
def
relative_url_root
...
...
spec/support/api_helpers.rb
View file @
07be5943
...
...
@@ -24,8 +24,11 @@ module ApiHelpers
(
path
.
index
(
'?'
)
?
''
:
'?'
)
+
# Append private_token if given a User object
(
user
.
respond_to?
(
:private_token
)
?
"&private_token=
#{
user
.
private_token
}
"
:
""
)
if
user
.
respond_to?
(
:private_token
)
"&private_token=
#{
user
.
private_token
}
"
else
''
end
end
def
ci_api
(
path
,
user
=
nil
)
...
...
@@ -35,8 +38,11 @@ module ApiHelpers
(
path
.
index
(
'?'
)
?
''
:
'?'
)
+
# Append private_token if given a User object
(
user
.
respond_to?
(
:private_token
)
?
"&private_token=
#{
user
.
private_token
}
"
:
""
)
if
user
.
respond_to?
(
:private_token
)
"&private_token=
#{
user
.
private_token
}
"
else
''
end
end
def
json_response
...
...
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