Commit 9a2f6fff authored by Gabriel Mazetto's avatar Gabriel Mazetto

Fix some cop violations and ignore Struct ones

parent 3549e457
...@@ -42,6 +42,7 @@ Naming/FileName: ...@@ -42,6 +42,7 @@ Naming/FileName:
- 'qa/bin/*' - 'qa/bin/*'
- 'config/**/*' - 'config/**/*'
- 'lib/generators/**/*' - 'lib/generators/**/*'
- 'ee/lib/generators/**/*'
IgnoreExecutableScripts: true IgnoreExecutableScripts: true
AllowedAcronyms: AllowedAcronyms:
- EE - EE
......
...@@ -8,7 +8,7 @@ module DeclarativePolicy ...@@ -8,7 +8,7 @@ module DeclarativePolicy
end end
def method_missing(m, *a, &b) def method_missing(m, *a, &b)
return super unless a.size == 0 && !block_given? return super unless a.empty? && !block_given?
@rule_dsl.delegate(@delegate_name, m) @rule_dsl.delegate(@delegate_name, m)
end end
......
module DeclarativePolicy module DeclarativePolicy # rubocop:disable Naming/FileName
PREFERRED_SCOPE_KEY = :"DeclarativePolicy.preferred_scope" PREFERRED_SCOPE_KEY = :"DeclarativePolicy.preferred_scope"
class << self class << self
......
...@@ -33,7 +33,7 @@ module DeclarativePolicy ...@@ -33,7 +33,7 @@ module DeclarativePolicy
end end
def method_missing(m, *a, &b) def method_missing(m, *a, &b)
return super unless a.size == 0 && !block_given? return super unless a.empty? && !block_given?
if @context_class.delegations.key?(m) if @context_class.delegations.key?(m)
DelegateDsl.new(self, m) DelegateDsl.new(self, m)
......
module Gitlab module Gitlab # rubocop:disable Naming/FileName
module Auth module Auth
Result = Struct.new(:actor, :project, :type, :authentication_abilities) do Result = Struct.new(:actor, :project, :type, :authentication_abilities) do
prepend ::EE::Gitlab::Auth::Result prepend ::EE::Gitlab::Auth::Result
......
module Gitlab module Gitlab # rubocop:disable Naming/FileName
module Ci module Ci
module Pipeline module Pipeline
module Chain module Chain
......
module Gitlab::HealthChecks module Gitlab::HealthChecks # rubocop:disable Naming/FileName
Metric = Struct.new(:name, :value, :labels) Metric = Struct.new(:name, :value, :labels)
end end
module Gitlab::HealthChecks module Gitlab::HealthChecks # rubocop:disable Naming/FileName
Result = Struct.new(:success, :message, :labels) Result = Struct.new(:success, :message, :labels)
end end
module Gitlab module Gitlab # rubocop:disable Naming/FileName
module Middleware module Middleware
# Some of middleware would hold env for no good reason even after the # Some of middleware would hold env for no good reason even after the
# request had already been processed, and we could not garbage collect # request had already been processed, and we could not garbage collect
......
module Gitlab module Gitlab # rubocop:disable Naming/FileName
module SlashCommands module SlashCommands
Result = Struct.new(:type, :message) Result = Struct.new(:type, :message)
end end
......
unless Rails.env.production? unless Rails.env.production? # rubocop:disable Naming/FileName
require 'haml_lint/haml_visitor' require 'haml_lint/haml_visitor'
require 'haml_lint/linter' require 'haml_lint/linter'
require 'haml_lint/linter_registry' require 'haml_lint/linter_registry'
......
module QA module QA # rubocop:disable Naming/FileName
module Page module Page
module Project module Project
module Settings module Settings
......
# rubocop:disable Naming/FileName
require_relative 'cop/gitlab/module_with_instance_variables' require_relative 'cop/gitlab/module_with_instance_variables'
require_relative 'cop/gitlab/predicate_memoization' require_relative 'cop/gitlab/predicate_memoization'
require_relative 'cop/include_sidekiq_worker' require_relative 'cop/include_sidekiq_worker'
......
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