summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.rubocop.yml4
-rw-r--r--app/controllers/projects/refs_controller.rb8
-rw-r--r--app/helpers/commits_helper.rb13
-rw-r--r--app/models/commit.rb11
-rw-r--r--app/services/projects/participants_service.rb11
-rw-r--r--config/initializers/acts_as_taggable_on_patch.rb11
6 files changed, 31 insertions, 27 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 369e55abcdb..c14303ab1f8 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -145,7 +145,7 @@ Style/CommentIndentation:
Style/ConstantName:
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
- Enabled: false
+ Enabled: true
Style/DefWithParentheses:
Description: 'Use def with parentheses when there are arguments.'
@@ -177,7 +177,7 @@ Style/EachWithObject:
Style/ElseAlignment:
Description: 'Align elses and elsifs correctly.'
- Enabled: false
+ Enabled: true
Style/EmptyElse:
Description: 'Avoid empty else-clauses.'
diff --git a/app/controllers/projects/refs_controller.rb b/app/controllers/projects/refs_controller.rb
index cede0ebe0ae..b80472f8eb4 100644
--- a/app/controllers/projects/refs_controller.rb
+++ b/app/controllers/projects/refs_controller.rb
@@ -31,10 +31,10 @@ class Projects::RefsController < Projects::ApplicationController
def logs_tree
@offset = if params[:offset].present?
- params[:offset].to_i
- else
- 0
- end
+ params[:offset].to_i
+ else
+ 0
+ end
@limit = 25
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 1a322ac048f..b4ba14160ed 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -112,12 +112,13 @@ module CommitsHelper
person_name = user.nil? ? source_name : user.name
person_email = user.nil? ? source_email : user.email
- 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: "")
- %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>}
- else
- person_name
- end
+ 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: "")
+ %Q{#{avatar} <span class="commit-#{options[:source]}-name">#{person_name}</span>}
+ else
+ person_name
+ end
options = {
class: "commit-#{options[:source]}-link has_tooltip",
diff --git a/app/models/commit.rb b/app/models/commit.rb
index baccf286740..e0461809e10 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -88,11 +88,12 @@ class Commit
# cut off, ellipses (`&hellp;`) are prepended to the commit message.
def description
title_end = safe_message.index("\n")
- @description ||= if (!title_end && safe_message.length > 100) || (title_end && title_end > 100)
- "&hellip;".html_safe << safe_message[80..-1]
- else
- safe_message.split("\n", 2)[1].try(:chomp)
- end
+ @description ||=
+ if (!title_end && safe_message.length > 100) || (title_end && title_end > 100)
+ "&hellip;".html_safe << safe_message[80..-1]
+ else
+ safe_message.split("\n", 2)[1].try(:chomp)
+ end
end
def description?
diff --git a/app/services/projects/participants_service.rb b/app/services/projects/participants_service.rb
index c4d2c0963b7..e3b33de8d02 100644
--- a/app/services/projects/participants_service.rb
+++ b/app/services/projects/participants_service.rb
@@ -5,11 +5,12 @@ module Projects
end
def execute(note_type, note_id)
- participating = if note_type && note_id
- participants_in(note_type, note_id)
- else
- []
- end
+ participating =
+ if note_type && note_id
+ participants_in(note_type, note_id)
+ else
+ []
+ end
team_members = sorted(@project.team.members)
participants = all_members + team_members + participating
participants.uniq
diff --git a/config/initializers/acts_as_taggable_on_patch.rb b/config/initializers/acts_as_taggable_on_patch.rb
index baa77fde392..e7a7728636d 100644
--- a/config/initializers/acts_as_taggable_on_patch.rb
+++ b/config/initializers/acts_as_taggable_on_patch.rb
@@ -42,11 +42,12 @@ module ActsAsTaggableOn::Taggable
elsif options.delete(:any)
# get tags, drop out if nothing returned (we need at least one)
- tags = if options.delete(:wild)
- ActsAsTaggableOn::Tag.named_like_any(tag_list)
- else
- ActsAsTaggableOn::Tag.named_any(tag_list)
- end
+ tags =
+ if options.delete(:wild)
+ ActsAsTaggableOn::Tag.named_like_any(tag_list)
+ else
+ ActsAsTaggableOn::Tag.named_any(tag_list)
+ end
return empty_result unless tags.length > 0