mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 21:26:07 +10:00
Merge branch 'rubocop/enable-literal-in-condition-cop' into 'master'
Enable Lint/LiteralInCondition rubocop cop Detects literals used in conditions. See #17478 See merge request !4354
This commit is contained in:
+1
-1
@@ -877,7 +877,7 @@ Lint/InvalidCharacterLiteral:
|
||||
|
||||
# Checks of literals used in conditions.
|
||||
Lint/LiteralInCondition:
|
||||
Enabled: false
|
||||
Enabled: true
|
||||
|
||||
# Checks for literals used in interpolation.
|
||||
Lint/LiteralInInterpolation:
|
||||
|
||||
@@ -25,18 +25,17 @@ class Ability
|
||||
|
||||
# List of possible abilities for anonymous user
|
||||
def anonymous_abilities(user, subject)
|
||||
case true
|
||||
when subject.is_a?(PersonalSnippet)
|
||||
if subject.is_a?(PersonalSnippet)
|
||||
anonymous_personal_snippet_abilities(subject)
|
||||
when subject.is_a?(ProjectSnippet)
|
||||
elsif subject.is_a?(ProjectSnippet)
|
||||
anonymous_project_snippet_abilities(subject)
|
||||
when subject.is_a?(CommitStatus)
|
||||
elsif subject.is_a?(CommitStatus)
|
||||
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)
|
||||
when subject.is_a?(Group) || subject.respond_to?(:group)
|
||||
elsif subject.is_a?(Group) || subject.respond_to?(:group)
|
||||
anonymous_group_abilities(subject)
|
||||
when subject.is_a?(User)
|
||||
elsif subject.is_a?(User)
|
||||
anonymous_user_abilities
|
||||
else
|
||||
[]
|
||||
|
||||
@@ -70,7 +70,7 @@ class IrkerService < Service
|
||||
private
|
||||
|
||||
def get_channels
|
||||
return true unless :activated?
|
||||
return true unless activated?
|
||||
return true if recipients.nil? || recipients.empty?
|
||||
|
||||
map_recipients
|
||||
|
||||
@@ -79,10 +79,9 @@ module Gitlab
|
||||
end
|
||||
|
||||
def state
|
||||
@state ||= case true
|
||||
when raw_data.state == 'closed' && raw_data.merged_at.present?
|
||||
@state ||= if raw_data.state == 'closed' && raw_data.merged_at.present?
|
||||
'merged'
|
||||
when raw_data.state == 'closed'
|
||||
elsif raw_data.state == 'closed'
|
||||
'closed'
|
||||
else
|
||||
'opened'
|
||||
|
||||
Reference in New Issue
Block a user