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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
86cf9dd2
Commit
86cf9dd2
authored
May 30, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable Lint/LiteralInCondition rubocop cop
Checks of literals used in conditions. See #17478
parent
43c35b0f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
12 deletions
+10
-12
.rubocop.yml
.rubocop.yml
+1
-1
app/models/ability.rb
app/models/ability.rb
+6
-7
app/models/project_services/irker_service.rb
app/models/project_services/irker_service.rb
+1
-1
lib/gitlab/github_import/pull_request_formatter.rb
lib/gitlab/github_import/pull_request_formatter.rb
+2
-3
No files found.
.rubocop.yml
View file @
86cf9dd2
...
@@ -878,7 +878,7 @@ Lint/InvalidCharacterLiteral:
...
@@ -878,7 +878,7 @@ Lint/InvalidCharacterLiteral:
# Checks of literals used in conditions.
# Checks of literals used in conditions.
Lint/LiteralInCondition
:
Lint/LiteralInCondition
:
Enabled
:
fals
e
Enabled
:
tru
e
# Checks for literals used in interpolation.
# Checks for literals used in interpolation.
Lint/LiteralInInterpolation
:
Lint/LiteralInInterpolation
:
...
...
app/models/ability.rb
View file @
86cf9dd2
...
@@ -25,18 +25,17 @@ class Ability
...
@@ -25,18 +25,17 @@ class Ability
# List of possible abilities for anonymous user
# List of possible abilities for anonymous user
def
anonymous_abilities
(
user
,
subject
)
def
anonymous_abilities
(
user
,
subject
)
case
true
if
subject
.
is_a?
(
PersonalSnippet
)
when
subject
.
is_a?
(
PersonalSnippet
)
anonymous_personal_snippet_abilities
(
subject
)
anonymous_personal_snippet_abilities
(
subject
)
when
subject
.
is_a?
(
ProjectSnippet
)
elsif
subject
.
is_a?
(
ProjectSnippet
)
anonymous_project_snippet_abilities
(
subject
)
anonymous_project_snippet_abilities
(
subject
)
when
subject
.
is_a?
(
CommitStatus
)
elsif
subject
.
is_a?
(
CommitStatus
)
anonymous_commit_status_abilities
(
subject
)
anonymous_commit_status_abilities
(
subject
)
when
subject
.
is_a?
(
Project
)
||
subject
.
respond_to?
(
:project
)
elsif
subject
.
is_a?
(
Project
)
||
subject
.
respond_to?
(
:project
)
anonymous_project_abilities
(
subject
)
anonymous_project_abilities
(
subject
)
when
subject
.
is_a?
(
Group
)
||
subject
.
respond_to?
(
:group
)
elsif
subject
.
is_a?
(
Group
)
||
subject
.
respond_to?
(
:group
)
anonymous_group_abilities
(
subject
)
anonymous_group_abilities
(
subject
)
when
subject
.
is_a?
(
User
)
elsif
subject
.
is_a?
(
User
)
anonymous_user_abilities
anonymous_user_abilities
else
else
[]
[]
...
...
app/models/project_services/irker_service.rb
View file @
86cf9dd2
...
@@ -70,7 +70,7 @@ class IrkerService < Service
...
@@ -70,7 +70,7 @@ class IrkerService < Service
private
private
def
get_channels
def
get_channels
return
true
unless
:
activated?
return
true
unless
activated?
return
true
if
recipients
.
nil?
||
recipients
.
empty?
return
true
if
recipients
.
nil?
||
recipients
.
empty?
map_recipients
map_recipients
...
...
lib/gitlab/github_import/pull_request_formatter.rb
View file @
86cf9dd2
...
@@ -79,10 +79,9 @@ module Gitlab
...
@@ -79,10 +79,9 @@ module Gitlab
end
end
def
state
def
state
@state
||=
case
true
@state
||=
if
raw_data
.
state
==
'closed'
&&
raw_data
.
merged_at
.
present?
when
raw_data
.
state
==
'closed'
&&
raw_data
.
merged_at
.
present?
'merged'
'merged'
when
raw_data
.
state
==
'closed'
elsif
raw_data
.
state
==
'closed'
'closed'
'closed'
else
else
'opened'
'opened'
...
...
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