Skip to content

Add cop InternalAffairs/MissingCopDepartment

Peter Leitzen requested to merge pl-cop-missing-departement into master

What does this MR do and why?

This MR:

  • Enables 👮 InternalAffairs/DeprecateCopHelper
  • 🆕 Adds a 👮 InternalAffairs/MissingCopDepartment
  • 🔁 Regenerates TODOs for 👮 InternalAffairs/MissingCopDepartment

Refs

Inspired by gitlab-org/gitlab!121334 (comment 1405255927)

Example

# bad
module RuboCop
  module Cop
    class Implicit
    end
  end
end
                     
module RuboCop
  module Cop
    module Cop
      class Explicit
      end
    end
  end
end
                     
# good
module RuboCop
  module Cop
    module Foo
      class Implicit
      end
    end
  end
end
                     
module RuboCop
  module Cop
    module Foo
      class Explicit
      end
    end
  end
end

Offenses

gitlab-styles

Offenses:

lib/rubocop/cop/active_record_dependent.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class ActiveRecordDependent < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/active_record_serialize.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class ActiveRecordSerialize < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/avoid_return_from_blocks.rb:23:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class AvoidReturnFromBlocks < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/custom_error_class.rb:18:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class CustomErrorClass < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^
lib/rubocop/cop/gem_fetcher.rb:8:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class GemFetcher < RuboCop::Cop::Base
          ^^^^^^^^^^
lib/rubocop/cop/in_batches.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class InBatches < RuboCop::Cop::Base
          ^^^^^^^^^
lib/rubocop/cop/line_break_after_guard_clauses.rb:58:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class LineBreakAfterGuardClauses < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/line_break_around_conditional_block.rb:45:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class LineBreakAroundConditionalBlock < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/polymorphic_associations.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class PolymorphicAssociations < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/redirect_with_status.rb:34:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class RedirectWithStatus < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^
lib/rubocop/cop/without_reactive_cache.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class WithoutReactiveCache < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^

117 files inspected, 11 offenses detected

gitlab-org

Inspecting 160 files
CC...CCCCC..C..........CCCCC........................................CCCC........................................CCCC....C......................C.....C.CCC.....C

Offenses:

rubocop/cop/active_model_errors_direct_manipulation.rb:9:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class ActiveModelErrorsDirectManipulation < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/active_record_association_reload.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class ActiveRecordAssociationReload < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/avoid_becomes.rb:12:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class AvoidBecomes < RuboCop::Cop::Base
          ^^^^^^^^^^^^
rubocop/cop/avoid_break_from_strong_memoize.rb:23:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class AvoidBreakFromStrongMemoize < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/avoid_keyword_arguments_in_sidekiq_workers.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class AvoidKeywordArgumentsInSidekiqWorkers < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/avoid_return_from_blocks.rb:23:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class AvoidReturnFromBlocks < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/avoid_route_redirect_leading_slash.rb:16:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class AvoidRouteRedirectLeadingSlash < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/ban_catch_throw.rb:22:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class BanCatchThrow < RuboCop::Cop::Base
          ^^^^^^^^^^^^^
rubocop/cop/default_scope.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class DefaultScope < RuboCop::Cop::Base
          ^^^^^^^^^^^^
rubocop/cop/destroy_all.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class DestroyAll < RuboCop::Cop::Base
          ^^^^^^^^^^
rubocop/cop/feature_flag_usage.rb:5:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class FeatureFlagUsage < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^
rubocop/cop/file_decompression.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class FileDecompression < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^
rubocop/cop/filename_length.rb:5:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class FilenameLength < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^
rubocop/cop/group_public_or_visible_to_user.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class GroupPublicOrVisibleToUser < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/ignored_columns.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class IgnoredColumns < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^
rubocop/cop/include_sidekiq_worker.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class IncludeSidekiqWorker < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^
rubocop/cop/inject_enterprise_edition_module.rb:7:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class InjectEnterpriseEditionModule < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/prefer_class_methods_over_module.rb:29:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class PreferClassMethodsOverModule < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/project_path_helper.rb:5:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class ProjectPathHelper < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^
rubocop/cop/put_group_routes_under_scope.rb:9:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class PutGroupRoutesUnderScope < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/put_project_routes_under_scope.rb:9:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class PutProjectRoutesUnderScope < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/redis_queue_usage.rb:7:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class RedisQueueUsage < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^
rubocop/cop/safe_params.rb:5:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class SafeParams < RuboCop::Cop::Base
          ^^^^^^^^^^
rubocop/cop/sidekiq_api_usage.rb:5:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class SidekiqApiUsage < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^
rubocop/cop/sidekiq_options_queue.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class SidekiqOptionsQueue < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^
rubocop/cop/sidekiq_redis_call.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class SidekiqRedisCall < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^
rubocop/cop/static_translation_definition.rb:54:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class StaticTranslationDefinition < RuboCop::Cop::Base
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
rubocop/cop/user_admin.rb:6:11: C: InternalAffairs/MissingCopDepartment: Define a proper department. Using Cop/ as department is discourged.
    class UserAdmin < RuboCop::Cop::Base
          ^^^^^^^^^

160 files inspected, 28 offenses detected
Edited by Peter Leitzen

Merge request reports

Loading