summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-01 21:56:17 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-07-01 21:56:17 +0200
commit9e211091a85c20adea63b89111240350d6d8ffcb (patch)
treeb4ba0fe2c948cdd32ed650371820c3ec376de83d /lib
parentb227355973fac017905833409e8cb721f9dbd36d (diff)
downloadgitlab-ce-rubocop/enable-cops-for-empty-lines.tar.gz
Enable Style/EmptyLines cop, remove redundant onesrubocop/enable-cops-for-empty-lines
Diffstat (limited to 'lib')
-rw-r--r--lib/api/award_emoji.rb1
-rw-r--r--lib/api/branches.rb2
-rw-r--r--lib/api/builds.rb1
-rw-r--r--lib/api/milestones.rb1
-rw-r--r--lib/api/project_hooks.rb1
-rw-r--r--lib/api/project_members.rb1
-rw-r--r--lib/api/projects.rb2
-rw-r--r--lib/api/services.rb1
-rw-r--r--lib/banzai/filter/image_link_filter.rb1
-rw-r--r--lib/banzai/filter/wiki_link_filter.rb1
-rw-r--r--lib/banzai/pipeline/full_pipeline.rb1
-rw-r--r--lib/ci/charts.rb1
-rw-r--r--lib/disable_email_interceptor.rb1
-rw-r--r--lib/gitlab/asciidoc.rb1
-rw-r--r--lib/gitlab/backend/grack_auth.rb1
-rw-r--r--lib/gitlab/diff/parser.rb1
-rw-r--r--lib/gitlab/import_export/importer.rb1
-rw-r--r--lib/gitlab/import_export/members_mapper.rb1
-rw-r--r--lib/gitlab/import_export/project_creator.rb1
-rw-r--r--lib/gitlab/import_export/project_tree_restorer.rb1
-rw-r--r--lib/gitlab/import_export/reader.rb2
-rw-r--r--lib/gitlab/import_export/relation_factory.rb1
-rw-r--r--lib/gitlab/import_export/shared.rb1
-rw-r--r--lib/gitlab/import_export/uploads_saver.rb1
-rw-r--r--lib/gitlab/import_export/version_checker.rb1
-rw-r--r--lib/gitlab/import_export/version_saver.rb1
-rw-r--r--lib/gitlab/import_sources.rb2
-rw-r--r--lib/gitlab/lfs/response.rb1
-rw-r--r--lib/gitlab/other_markup.rb1
-rw-r--r--lib/gitlab/regex.rb6
-rw-r--r--lib/gitlab/saml/auth_hash.rb2
-rw-r--r--lib/gitlab/saml/config.rb2
-rw-r--r--lib/gitlab/saml/user.rb1
-rw-r--r--lib/uploaded_file.rb1
34 files changed, 0 insertions, 45 deletions
diff --git a/lib/api/award_emoji.rb b/lib/api/award_emoji.rb
index 985590312e3..c4fa1838b5a 100644
--- a/lib/api/award_emoji.rb
+++ b/lib/api/award_emoji.rb
@@ -11,7 +11,6 @@ module API
[ ":id/#{awardable_string}/:#{awardable_id_string}/award_emoji",
":id/#{awardable_string}/:#{awardable_id_string}/notes/:note_id/award_emoji"
].each do |endpoint|
-
# Get a list of project +awardable+ award emoji
#
# Parameters:
diff --git a/lib/api/branches.rb b/lib/api/branches.rb
index 9f9ae75ff65..d467eb9d474 100644
--- a/lib/api/branches.rb
+++ b/lib/api/branches.rb
@@ -40,7 +40,6 @@ module API
# PUT /projects/:id/repository/branches/:branch/protect
put ':id/repository/branches/:branch/protect',
requirements: { branch: /.+/ } do
-
authorize_admin_project
@branch = user_project.repository.find_branch(params[:branch])
@@ -60,7 +59,6 @@ module API
# PUT /projects/:id/repository/branches/:branch/unprotect
put ':id/repository/branches/:branch/unprotect',
requirements: { branch: /.+/ } do
-
authorize_admin_project
@branch = user_project.repository.find_branch(params[:branch])
diff --git a/lib/api/builds.rb b/lib/api/builds.rb
index 086d8511e8f..d36047acd1f 100644
--- a/lib/api/builds.rb
+++ b/lib/api/builds.rb
@@ -13,7 +13,6 @@ module API
# Example Request:
# GET /projects/:id/builds
get ':id/builds' do
-
builds = user_project.builds.order('id DESC')
builds = filter_builds(builds, params[:scope])
diff --git a/lib/api/milestones.rb b/lib/api/milestones.rb
index 132043cf3f7..7a0cb7c99f3 100644
--- a/lib/api/milestones.rb
+++ b/lib/api/milestones.rb
@@ -115,7 +115,6 @@ module API
issues = IssuesFinder.new(current_user, finder_params).execute
present paginate(issues), with: Entities::Issue, current_user: current_user
end
-
end
end
end
diff --git a/lib/api/project_hooks.rb b/lib/api/project_hooks.rb
index ccca65cbe1c..6bb70bc8bc3 100644
--- a/lib/api/project_hooks.rb
+++ b/lib/api/project_hooks.rb
@@ -28,7 +28,6 @@ module API
present @hook, with: Entities::ProjectHook
end
-
# Add hook to project
#
# Parameters:
diff --git a/lib/api/project_members.rb b/lib/api/project_members.rb
index b703da0557a..6a0b3e7d134 100644
--- a/lib/api/project_members.rb
+++ b/lib/api/project_members.rb
@@ -4,7 +4,6 @@ module API
before { authenticate! }
resource :projects do
-
# Get a project team members
#
# Parameters:
diff --git a/lib/api/projects.rb b/lib/api/projects.rb
index 5a22d14988f..0cc1edd65c8 100644
--- a/lib/api/projects.rb
+++ b/lib/api/projects.rb
@@ -341,7 +341,6 @@ module API
else
not_found!("Source Project")
end
-
end
# Remove a forked_from relationship
@@ -418,7 +417,6 @@ module API
present paginate(projects), with: Entities::Project
end
-
# Get a users list
#
# Example Request:
diff --git a/lib/api/services.rb b/lib/api/services.rb
index 203f04a6259..fc8598daa32 100644
--- a/lib/api/services.rb
+++ b/lib/api/services.rb
@@ -4,7 +4,6 @@ module API
before { authenticate! }
before { authorize_admin_project }
-
resource :projects do
# Set <service_slug> service for project
#
diff --git a/lib/banzai/filter/image_link_filter.rb b/lib/banzai/filter/image_link_filter.rb
index 8aa6f8f124a..f0fb6084a35 100644
--- a/lib/banzai/filter/image_link_filter.rb
+++ b/lib/banzai/filter/image_link_filter.rb
@@ -8,7 +8,6 @@ module Banzai
# of the anchor, and then replace the img with the link-wrapped version.
def call
doc.xpath('descendant-or-self::img[not(ancestor::a)]').each do |img|
-
div = doc.document.create_element(
'div',
class: 'image-container'
diff --git a/lib/banzai/filter/wiki_link_filter.rb b/lib/banzai/filter/wiki_link_filter.rb
index 1bb6d6bba87..269d5bf74fa 100644
--- a/lib/banzai/filter/wiki_link_filter.rb
+++ b/lib/banzai/filter/wiki_link_filter.rb
@@ -8,7 +8,6 @@ module Banzai
# Context options:
# :project_wiki
class WikiLinkFilter < HTML::Pipeline::Filter
-
def call
return doc unless project_wiki?
diff --git a/lib/banzai/pipeline/full_pipeline.rb b/lib/banzai/pipeline/full_pipeline.rb
index d47ddfda4be..3c974f73176 100644
--- a/lib/banzai/pipeline/full_pipeline.rb
+++ b/lib/banzai/pipeline/full_pipeline.rb
@@ -1,7 +1,6 @@
module Banzai
module Pipeline
class FullPipeline < CombinedPipeline.new(PlainMarkdownPipeline, GfmPipeline)
-
end
end
end
diff --git a/lib/ci/charts.rb b/lib/ci/charts.rb
index 5270108ef0f..1d7126a432d 100644
--- a/lib/ci/charts.rb
+++ b/lib/ci/charts.rb
@@ -13,7 +13,6 @@ module Ci
collect
end
-
def push(from, to, format)
@labels << from.strftime(format)
@total << project.builds.
diff --git a/lib/disable_email_interceptor.rb b/lib/disable_email_interceptor.rb
index 1b80be112a4..cee664b8951 100644
--- a/lib/disable_email_interceptor.rb
+++ b/lib/disable_email_interceptor.rb
@@ -1,6 +1,5 @@
# Read about interceptors in http://guides.rubyonrails.org/action_mailer_basics.html#intercepting-emails
class DisableEmailInterceptor
-
def self.delivering_email(message)
message.perform_deliveries = false
Rails.logger.info "Emails disabled! Interceptor prevented sending mail #{message.subject}"
diff --git a/lib/gitlab/asciidoc.rb b/lib/gitlab/asciidoc.rb
index 0b9c2e730f9..1a22ad9acf5 100644
--- a/lib/gitlab/asciidoc.rb
+++ b/lib/gitlab/asciidoc.rb
@@ -4,7 +4,6 @@ module Gitlab
# Parser/renderer for the AsciiDoc format that uses Asciidoctor and filters
# the resulting HTML through HTML pipeline filters.
module Asciidoc
-
DEFAULT_ADOC_ATTRS = [
'showtitle', 'idprefix=user-content-', 'idseparator=-', 'env=gitlab',
'env-gitlab', 'source-highlighter=html-pipeline'
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index ad412f56cca..478f145bfed 100644
--- a/lib/gitlab/backend/grack_auth.rb
+++ b/lib/gitlab/backend/grack_auth.rb
@@ -8,7 +8,6 @@ module Grack
end
class Auth < Rack::Auth::Basic
-
attr_accessor :user, :project, :env
def call(env)
diff --git a/lib/gitlab/diff/parser.rb b/lib/gitlab/diff/parser.rb
index 522dd2b9428..59a2367b65d 100644
--- a/lib/gitlab/diff/parser.rb
+++ b/lib/gitlab/diff/parser.rb
@@ -40,7 +40,6 @@ module Gitlab
line_obj_index += 1
end
-
case line[0]
when "+"
line_new += 1
diff --git a/lib/gitlab/import_export/importer.rb b/lib/gitlab/import_export/importer.rb
index 595b20a09bd..8f66f48cbfe 100644
--- a/lib/gitlab/import_export/importer.rb
+++ b/lib/gitlab/import_export/importer.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class Importer
-
def initialize(project)
@archive_file = project.import_source
@current_user = project.creator
diff --git a/lib/gitlab/import_export/members_mapper.rb b/lib/gitlab/import_export/members_mapper.rb
index c569a35a48b..b459054c198 100644
--- a/lib/gitlab/import_export/members_mapper.rb
+++ b/lib/gitlab/import_export/members_mapper.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class MembersMapper
-
attr_reader :missing_author_ids
def initialize(exported_members:, user:, project:)
diff --git a/lib/gitlab/import_export/project_creator.rb b/lib/gitlab/import_export/project_creator.rb
index 89388d1984b..77bb3ca6581 100644
--- a/lib/gitlab/import_export/project_creator.rb
+++ b/lib/gitlab/import_export/project_creator.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class ProjectCreator
-
def initialize(namespace_id, current_user, file, project_path)
@namespace_id = namespace_id
@current_user = current_user
diff --git a/lib/gitlab/import_export/project_tree_restorer.rb b/lib/gitlab/import_export/project_tree_restorer.rb
index dd71b92c522..0ac6ff01e3b 100644
--- a/lib/gitlab/import_export/project_tree_restorer.rb
+++ b/lib/gitlab/import_export/project_tree_restorer.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class ProjectTreeRestorer
-
def initialize(user:, shared:, project:)
@path = File.join(shared.export_path, 'project.json')
@user = user
diff --git a/lib/gitlab/import_export/reader.rb b/lib/gitlab/import_export/reader.rb
index 19defd8f03a..15f5dd31035 100644
--- a/lib/gitlab/import_export/reader.rb
+++ b/lib/gitlab/import_export/reader.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class Reader
-
attr_reader :tree
def initialize(shared:)
@@ -55,7 +54,6 @@ module Gitlab
@json_config_hash
end
-
# If the model is a hash, process the sub_models, which could also be hashes
# If there is a list, add to an existing array, otherwise use hash syntax
# +current_key+ main model that will be a key in the hash
diff --git a/lib/gitlab/import_export/relation_factory.rb b/lib/gitlab/import_export/relation_factory.rb
index 3fd89e08f09..9824df3f274 100644
--- a/lib/gitlab/import_export/relation_factory.rb
+++ b/lib/gitlab/import_export/relation_factory.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class RelationFactory
-
OVERRIDES = { snippets: :project_snippets,
pipelines: 'Ci::Pipeline',
statuses: 'commit_status',
diff --git a/lib/gitlab/import_export/shared.rb b/lib/gitlab/import_export/shared.rb
index 6aff05b886a..5d6de8bc475 100644
--- a/lib/gitlab/import_export/shared.rb
+++ b/lib/gitlab/import_export/shared.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class Shared
-
attr_reader :errors, :opts
def initialize(opts)
diff --git a/lib/gitlab/import_export/uploads_saver.rb b/lib/gitlab/import_export/uploads_saver.rb
index 7292e9d9712..d6f4fa57510 100644
--- a/lib/gitlab/import_export/uploads_saver.rb
+++ b/lib/gitlab/import_export/uploads_saver.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class UploadsSaver
-
def initialize(project:, shared:)
@project = project
@shared = shared
diff --git a/lib/gitlab/import_export/version_checker.rb b/lib/gitlab/import_export/version_checker.rb
index cf5c62c5e3c..abfc694b879 100644
--- a/lib/gitlab/import_export/version_checker.rb
+++ b/lib/gitlab/import_export/version_checker.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class VersionChecker
-
def self.check!(*args)
new(*args).check!
end
diff --git a/lib/gitlab/import_export/version_saver.rb b/lib/gitlab/import_export/version_saver.rb
index f7f73dc9343..9b642d740b7 100644
--- a/lib/gitlab/import_export/version_saver.rb
+++ b/lib/gitlab/import_export/version_saver.rb
@@ -1,7 +1,6 @@
module Gitlab
module ImportExport
class VersionSaver
-
def initialize(shared:)
@shared = shared
end
diff --git a/lib/gitlab/import_sources.rb b/lib/gitlab/import_sources.rb
index 948d43582cf..59a05411fe9 100644
--- a/lib/gitlab/import_sources.rb
+++ b/lib/gitlab/import_sources.rb
@@ -24,8 +24,6 @@ module Gitlab
'GitLab export' => 'gitlab_project'
}
end
-
end
-
end
end
diff --git a/lib/gitlab/lfs/response.rb b/lib/gitlab/lfs/response.rb
index e3ed2f6791d..811363405a8 100644
--- a/lib/gitlab/lfs/response.rb
+++ b/lib/gitlab/lfs/response.rb
@@ -1,7 +1,6 @@
module Gitlab
module Lfs
class Response
-
def initialize(project, user, ci, request)
@origin_project = project
@project = storage_project(project)
diff --git a/lib/gitlab/other_markup.rb b/lib/gitlab/other_markup.rb
index 746ec283330..4e2f8ed5587 100644
--- a/lib/gitlab/other_markup.rb
+++ b/lib/gitlab/other_markup.rb
@@ -1,7 +1,6 @@
module Gitlab
# Parser/renderer for markups without other special support code.
module OtherMarkup
-
# Public: Converts the provided markup into HTML.
#
# input - the source text in a markup format
diff --git a/lib/gitlab/regex.rb b/lib/gitlab/regex.rb
index c84c68f96f6..ffad5e17c78 100644
--- a/lib/gitlab/regex.rb
+++ b/lib/gitlab/regex.rb
@@ -13,7 +13,6 @@ module Gitlab
"Cannot start with '-' or end in '.'." \
end
-
def namespace_name_regex
@namespace_name_regex ||= /\A[\p{Alnum}\p{Pd}_\. ]*\z/.freeze
end
@@ -22,7 +21,6 @@ module Gitlab
"can contain only letters, digits, '_', '.', dash and space."
end
-
def project_name_regex
@project_name_regex ||= /\A[\p{Alnum}_][\p{Alnum}\p{Pd}_\. ]*\z/.freeze
end
@@ -32,7 +30,6 @@ module Gitlab
"It must start with letter, digit or '_'."
end
-
def project_path_regex
@project_path_regex ||= /\A[a-zA-Z0-9_.][a-zA-Z0-9_\-\.]*(?<!\.git|\.atom)\z/.freeze
end
@@ -42,7 +39,6 @@ module Gitlab
"Cannot start with '-', end in '.git' or end in '.atom'" \
end
-
def file_name_regex
@file_name_regex ||= /\A[a-zA-Z0-9_\-\.\@]*\z/.freeze
end
@@ -59,7 +55,6 @@ module Gitlab
"can contain only letters, digits, '_', '-', '@' and '.'. Separate directories with a '/'. "
end
-
def directory_traversal_regex
@directory_traversal_regex ||= /\.{2}/.freeze
end
@@ -68,7 +63,6 @@ module Gitlab
"cannot include directory traversal. "
end
-
def archive_formats_regex
# |zip|tar| tar.gz | tar.bz2 |
@archive_formats_regex ||= /(zip|tar|tar\.gz|tgz|gz|tar\.bz2|tbz|tbz2|tb2|bz2)/.freeze
diff --git a/lib/gitlab/saml/auth_hash.rb b/lib/gitlab/saml/auth_hash.rb
index 32c1c9ec5bb..67a5f368bdb 100644
--- a/lib/gitlab/saml/auth_hash.rb
+++ b/lib/gitlab/saml/auth_hash.rb
@@ -1,7 +1,6 @@
module Gitlab
module Saml
class AuthHash < Gitlab::OAuth::AuthHash
-
def groups
get_raw(Gitlab::Saml::Config.groups)
end
@@ -13,7 +12,6 @@ module Gitlab
# otherwise just the first value is returned
auth_hash.extra[:raw_info].all[key]
end
-
end
end
end
diff --git a/lib/gitlab/saml/config.rb b/lib/gitlab/saml/config.rb
index 0f40c00f547..574c3a4b28c 100644
--- a/lib/gitlab/saml/config.rb
+++ b/lib/gitlab/saml/config.rb
@@ -1,7 +1,6 @@
module Gitlab
module Saml
class Config
-
class << self
def options
Gitlab.config.omniauth.providers.find { |provider| provider.name == 'saml' }
@@ -15,7 +14,6 @@ module Gitlab
options[:external_groups]
end
end
-
end
end
end
diff --git a/lib/gitlab/saml/user.rb b/lib/gitlab/saml/user.rb
index 8943022612c..f253dc7477e 100644
--- a/lib/gitlab/saml/user.rb
+++ b/lib/gitlab/saml/user.rb
@@ -6,7 +6,6 @@
module Gitlab
module Saml
class User < Gitlab::OAuth::User
-
def save
super('SAML')
end
diff --git a/lib/uploaded_file.rb b/lib/uploaded_file.rb
index d4291f012d3..41dee5fdc06 100644
--- a/lib/uploaded_file.rb
+++ b/lib/uploaded_file.rb
@@ -3,7 +3,6 @@ require "fileutils"
# Taken from: Rack::Test::UploadedFile
class UploadedFile
-
# The filename, *not* including the path, of the "uploaded" file
attr_reader :original_filename