From 2aa2f52191b746df851853cf5fe9ce7249a70739 Mon Sep 17 00:00:00 2001 From: Gabriel Mazetto Date: Sat, 6 Aug 2016 03:44:39 +0200 Subject: [PATCH 1/2] Enable Style/EmptyLinesAroundModuleBody cop --- .rubocop.yml | 2 +- app/helpers/avatars_helper.rb | 2 -- lib/banzai/filter/video_link_filter.rb | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 556a5d11a39..b05ac369f61 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -157,7 +157,7 @@ Style/EmptyLinesAroundClassBody: # Keeps track of empty lines around module bodies. Style/EmptyLinesAroundModuleBody: - Enabled: false + Enabled: true # Keeps track of empty lines around method bodies. Style/EmptyLinesAroundMethodBody: diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index 6ff40c6b461..2160cf7a690 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -1,5 +1,4 @@ module AvatarsHelper - def author_avatar(commit_or_event, options = {}) user_avatar(options.merge({ user: commit_or_event.author, @@ -26,5 +25,4 @@ module AvatarsHelper mail_to(options[:user_email], avatar) end end - end diff --git a/lib/banzai/filter/video_link_filter.rb b/lib/banzai/filter/video_link_filter.rb index fd8b9a6f0cc..0f86ae83f72 100644 --- a/lib/banzai/filter/video_link_filter.rb +++ b/lib/banzai/filter/video_link_filter.rb @@ -1,6 +1,5 @@ module Banzai module Filter - # Find every image that isn't already wrapped in an `a` tag, and that has # a `src` attribute ending with a video extension, add a new video node and # a "Download" link in the case the video cannot be played. @@ -54,6 +53,5 @@ module Banzai container end end - end end From 5f6223cf9f285da3814991d1271e328e23be9d45 Mon Sep 17 00:00:00 2001 From: Gabriel Mazetto Date: Sat, 6 Aug 2016 03:52:24 +0200 Subject: [PATCH 2/2] Enable Style/EmptyLinesAroundClassBody cop --- .rubocop.yml | 2 +- lib/banzai/filter/video_link_filter.rb | 1 - lib/gitlab/import_export/avatar_restorer.rb | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b05ac369f61..cf3607f985b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -153,7 +153,7 @@ Style/EmptyLinesAroundBlockBody: # Keeps track of empty lines around class bodies. Style/EmptyLinesAroundClassBody: - Enabled: false + Enabled: true # Keeps track of empty lines around module bodies. Style/EmptyLinesAroundModuleBody: diff --git a/lib/banzai/filter/video_link_filter.rb b/lib/banzai/filter/video_link_filter.rb index 0f86ae83f72..ac7bbcb0d10 100644 --- a/lib/banzai/filter/video_link_filter.rb +++ b/lib/banzai/filter/video_link_filter.rb @@ -4,7 +4,6 @@ module Banzai # a `src` attribute ending with a video extension, add a new video node and # a "Download" link in the case the video cannot be played. class VideoLinkFilter < HTML::Pipeline::Filter - def call doc.xpath(query).each do |el| el.replace(video_node(doc, el)) diff --git a/lib/gitlab/import_export/avatar_restorer.rb b/lib/gitlab/import_export/avatar_restorer.rb index 352539eb594..cfa595629f4 100644 --- a/lib/gitlab/import_export/avatar_restorer.rb +++ b/lib/gitlab/import_export/avatar_restorer.rb @@ -1,7 +1,6 @@ module Gitlab module ImportExport class AvatarRestorer - def initialize(project:, shared:) @project = project @shared = shared