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