BigW Consortium Gitlab

Commit 647ff624 by Dmitriy Zaporozhets

Rubocop: Style/ElseAlignment enabled

parent 7d48205c
...@@ -145,7 +145,7 @@ Style/CommentIndentation: ...@@ -145,7 +145,7 @@ Style/CommentIndentation:
Style/ConstantName: Style/ConstantName:
Description: 'Constants should use SCREAMING_SNAKE_CASE.' Description: 'Constants should use SCREAMING_SNAKE_CASE.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case' StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
Enabled: false Enabled: true
Style/DefWithParentheses: Style/DefWithParentheses:
Description: 'Use def with parentheses when there are arguments.' Description: 'Use def with parentheses when there are arguments.'
...@@ -177,7 +177,7 @@ Style/EachWithObject: ...@@ -177,7 +177,7 @@ Style/EachWithObject:
Style/ElseAlignment: Style/ElseAlignment:
Description: 'Align elses and elsifs correctly.' Description: 'Align elses and elsifs correctly.'
Enabled: false Enabled: true
Style/EmptyElse: Style/EmptyElse:
Description: 'Avoid empty else-clauses.' Description: 'Avoid empty else-clauses.'
......
...@@ -112,7 +112,8 @@ module CommitsHelper ...@@ -112,7 +112,8 @@ module CommitsHelper
person_name = user.nil? ? source_name : user.name person_name = user.nil? ? source_name : user.name
person_email = user.nil? ? source_email : user.email person_email = user.nil? ? source_email : user.email
text = if options[:avatar] text =
if options[:avatar]
avatar = image_tag(avatar_icon(person_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "") avatar = image_tag(avatar_icon(person_email, options[:size]), class: "avatar #{"s#{options[:size]}" if options[:size]}", width: options[:size], alt: "")
%Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>} %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>}
else else
......
...@@ -88,7 +88,8 @@ class Commit ...@@ -88,7 +88,8 @@ class Commit
# cut off, ellipses (`&hellp;`) are prepended to the commit message. # cut off, ellipses (`&hellp;`) are prepended to the commit message.
def description def description
title_end = safe_message.index("\n") title_end = safe_message.index("\n")
@description ||= if (!title_end && safe_message.length > 100) || (title_end && title_end > 100) @description ||=
if (!title_end && safe_message.length > 100) || (title_end && title_end > 100)
"&hellip;".html_safe << safe_message[80..-1] "&hellip;".html_safe << safe_message[80..-1]
else else
safe_message.split("\n", 2)[1].try(:chomp) safe_message.split("\n", 2)[1].try(:chomp)
......
...@@ -5,7 +5,8 @@ module Projects ...@@ -5,7 +5,8 @@ module Projects
end end
def execute(note_type, note_id) def execute(note_type, note_id)
participating = if note_type && note_id participating =
if note_type && note_id
participants_in(note_type, note_id) participants_in(note_type, note_id)
else else
[] []
......
...@@ -42,7 +42,8 @@ module ActsAsTaggableOn::Taggable ...@@ -42,7 +42,8 @@ module ActsAsTaggableOn::Taggable
elsif options.delete(:any) elsif options.delete(:any)
# get tags, drop out if nothing returned (we need at least one) # get tags, drop out if nothing returned (we need at least one)
tags = if options.delete(:wild) tags =
if options.delete(:wild)
ActsAsTaggableOn::Tag.named_like_any(tag_list) ActsAsTaggableOn::Tag.named_like_any(tag_list)
else else
ActsAsTaggableOn::Tag.named_any(tag_list) ActsAsTaggableOn::Tag.named_any(tag_list)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment