diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/command_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/command_file_placement_spec.rb index 235f1ac5..2f73b151 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/command_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/command_file_placement_spec.rb @@ -25,7 +25,7 @@ it "when command is defined directly inside app/commands/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/commands/`. Namespace them like `app/commands/my_component/foo.rb` + ^^^^^^^^^ Cobra/CommandFilePlacement: Do not add top-level files into `app/commands/`. Namespace them like `app/commands/my_component/foo.rb` end RUBY @@ -37,7 +37,7 @@ class Foo it "when command is defined inside a different subdirectory of app/commands/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/commands/`. Namespace them like `app/commands/my_component/other_namespace/foo.rb` + ^^^^^^^^^ Cobra/CommandFilePlacement: Do not add top-level files into `app/commands/`. Namespace them like `app/commands/my_component/other_namespace/foo.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/controller_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/controller_file_placement_spec.rb index f9e96212..b6248bc8 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/controller_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/controller_file_placement_spec.rb @@ -31,7 +31,7 @@ it "when controller is defined directly inside app/controllers/" do source = <<~RUBY class FooController - ^^^^^^^^^^^^^^^^^^^ Do not add top-level files into `app/controllers/`. Namespace them like `app/controllers/my_component/foo_controller.rb` + ^^^^^^^^^^^^^^^^^^^ Cobra/ControllerFilePlacement: Do not add top-level files into `app/controllers/`. Namespace them like `app/controllers/my_component/foo_controller.rb` end RUBY @@ -43,7 +43,7 @@ class FooController it "when controller is defined inside a different subdirectory of app/controllers/" do source = <<~RUBY class FooController - ^^^^^^^^^^^^^^^^^^^ Do not add top-level files into `app/controllers/`. Namespace them like `app/controllers/my_component/other_namespace/foo_controller.rb` + ^^^^^^^^^^^^^^^^^^^ Cobra/ControllerFilePlacement: Do not add top-level files into `app/controllers/`. Namespace them like `app/controllers/my_component/other_namespace/foo_controller.rb` end RUBY @@ -55,7 +55,7 @@ class FooController it "when file is directly inside a concerns directory inside app/controllers/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/controllers/concerns/`. Namespace them like `app/controllers/concerns/my_component/foo.rb` + ^^^^^^^^^ Cobra/ControllerFilePlacement: Do not add top-level files into `app/controllers/concerns/`. Namespace them like `app/controllers/concerns/my_component/foo.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/gem_requirement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/gem_requirement_spec.rb index e8e1d6b9..dad6c03b 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/gem_requirement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/gem_requirement_spec.rb @@ -61,7 +61,7 @@ path ".." do gem "nitro_component", require: true - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Component Gemfile dependencies must specify 'require: nil'. + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Cobra/GemRequirement: Component Gemfile dependencies must specify 'require: nil'. end RUBY end @@ -72,7 +72,7 @@ path ".." do gem "nitro_component" - ^^^^^^^^^^^^^^^^^^^^^ Component Gemfile dependencies must specify 'require: nil'. + ^^^^^^^^^^^^^^^^^^^^^ Cobra/GemRequirement: Component Gemfile dependencies must specify 'require: nil'. end RUBY end @@ -85,7 +85,7 @@ # Dependencies on other components go here gem "nitro_component", require: nil gem "other_component" - ^^^^^^^^^^^^^^^^^^^^^ Component Gemfile dependencies must specify 'require: nil'. + ^^^^^^^^^^^^^^^^^^^^^ Cobra/GemRequirement: Component Gemfile dependencies must specify 'require: nil'. gem "another_component", require: nil end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/helper_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/helper_file_placement_spec.rb index a61eefa7..09232a07 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/helper_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/helper_file_placement_spec.rb @@ -25,7 +25,7 @@ it "when helper is defined directly inside app/helpers/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/helpers/`. Namespace them like `app/helpers/my_component/foo.rb` + ^^^^^^^^^ Cobra/HelperFilePlacement: Do not add top-level files into `app/helpers/`. Namespace them like `app/helpers/my_component/foo.rb` end RUBY @@ -37,7 +37,7 @@ class Foo it "when helper is defined inside a different subdirectory of app/helpers/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/helpers/`. Namespace them like `app/helpers/my_component/other_namespace/foo.rb` + ^^^^^^^^^ Cobra/HelperFilePlacement: Do not add top-level files into `app/helpers/`. Namespace them like `app/helpers/my_component/other_namespace/foo.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/inheritance_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/inheritance_spec.rb index b757ee1c..27afaf55 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/inheritance_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/inheritance_spec.rb @@ -15,7 +15,7 @@ class FooController < MyComponent::ApplicationController it "registers an offense when inheriting from ApplicationController" do expect_offense(<<-RUBY) class FooController < ApplicationController - ^^^^^^^^^^^^^^^^^^^^^ Do not directly inherit from a global ApplicationController. Instead, inherit from your component's modularized ApplicationController, such as MyComponent::ApplicationController. + ^^^^^^^^^^^^^^^^^^^^^ Cobra/Inheritance: Do not directly inherit from a global ApplicationController. Instead, inherit from your component's modularized ApplicationController, such as MyComponent::ApplicationController. end RUBY end @@ -30,7 +30,7 @@ class Foo < MyComponent::ApplicationRecord it "registers an offense when inheriting from ApplicationRecord" do expect_offense(<<-RUBY) class Foo < ApplicationRecord - ^^^^^^^^^^^^^^^^^ Do not directly inherit from a global ApplicationRecord. Instead, inherit from your component's modularized ApplicationRecord, such as MyComponent::ApplicationRecord. + ^^^^^^^^^^^^^^^^^ Cobra/Inheritance: Do not directly inherit from a global ApplicationRecord. Instead, inherit from your component's modularized ApplicationRecord, such as MyComponent::ApplicationRecord. end RUBY end @@ -45,7 +45,7 @@ class FooController < MyComponent::ApiController it "registers an offense when inheriting from ApiController" do expect_offense(<<-RUBY) class FooController < ApiController - ^^^^^^^^^^^^^ Do not directly inherit from a global ApiController. Instead, inherit from your component's modularized ApiController, such as MyComponent::ApiController. + ^^^^^^^^^^^^^ Cobra/Inheritance: Do not directly inherit from a global ApiController. Instead, inherit from your component's modularized ApiController, such as MyComponent::ApiController. end RUBY end diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/job_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/job_file_placement_spec.rb index 1dc3b4d6..e5efd412 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/job_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/job_file_placement_spec.rb @@ -25,7 +25,7 @@ it "when job is defined directly inside app/jobs/" do source = <<~RUBY class FooJob - ^^^^^^^^^^^^ Do not add top-level files into `app/jobs/`. Namespace them like `app/jobs/my_component/foo_job.rb` + ^^^^^^^^^^^^ Cobra/JobFilePlacement: Do not add top-level files into `app/jobs/`. Namespace them like `app/jobs/my_component/foo_job.rb` end RUBY @@ -37,7 +37,7 @@ class FooJob it "when job is defined directly inside mismatched subdirectory of app/jobs/" do source = <<~RUBY class FooJob - ^^^^^^^^^^^^ Do not add top-level files into `app/jobs/`. Namespace them like `app/jobs/my_component/other_namespace/foo_job.rb` + ^^^^^^^^^^^^ Cobra/JobFilePlacement: Do not add top-level files into `app/jobs/`. Namespace them like `app/jobs/my_component/other_namespace/foo_job.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/lib_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/lib_file_placement_spec.rb index 65250629..811ebc0f 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/lib_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/lib_file_placement_spec.rb @@ -49,7 +49,7 @@ it "when lib file is defined directly inside lib/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `lib/`. Namespace them like `lib/awesome_component/foo.rb` + ^^^^^^^^^ Cobra/LibFilePlacement: Do not add top-level files into `lib/`. Namespace them like `lib/awesome_component/foo.rb` end RUBY @@ -61,7 +61,7 @@ class Foo it "when lib file is defined inside a different subdirectory of lib/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `lib/`. Namespace them like `lib/my_component/other_namespace/my_file.rb` + ^^^^^^^^^ Cobra/LibFilePlacement: Do not add top-level files into `lib/`. Namespace them like `lib/my_component/other_namespace/my_file.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/mailer_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/mailer_file_placement_spec.rb index fd75c7f8..23f09177 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/mailer_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/mailer_file_placement_spec.rb @@ -25,7 +25,7 @@ it "when mailer is defined directly inside app/mailers/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/mailers/`. Namespace them like `app/mailers/my_component/foo.rb` + ^^^^^^^^^ Cobra/MailerFilePlacement: Do not add top-level files into `app/mailers/`. Namespace them like `app/mailers/my_component/foo.rb` end RUBY @@ -37,7 +37,7 @@ class Foo it "when mailer is defined inside a different subdirectory of app/mailers/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/mailers/`. Namespace them like `app/mailers/my_component/other_namespace/foo.rb` + ^^^^^^^^^ Cobra/MailerFilePlacement: Do not add top-level files into `app/mailers/`. Namespace them like `app/mailers/my_component/other_namespace/foo.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/model_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/model_file_placement_spec.rb index e077703e..f9f746ff 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/model_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/model_file_placement_spec.rb @@ -31,7 +31,7 @@ it "when model is defined directly inside app/models/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/models/`. Namespace them like `app/models/my_component/foo.rb` + ^^^^^^^^^ Cobra/ModelFilePlacement: Do not add top-level files into `app/models/`. Namespace them like `app/models/my_component/foo.rb` end RUBY @@ -43,7 +43,7 @@ class Foo it "when model is defined directly inside mismatched subdirectory of app/models/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/models/`. Namespace them like `app/models/my_component/other_namespace/foo.rb` + ^^^^^^^^^ Cobra/ModelFilePlacement: Do not add top-level files into `app/models/`. Namespace them like `app/models/my_component/other_namespace/foo.rb` end RUBY @@ -55,7 +55,7 @@ class Foo it "when file is directly inside a concerns directory inside of app/models/" do source = <<~RUBY class Foo - ^^^^^^^^^ Do not add top-level files into `app/models/concerns/`. Namespace them like `app/models/concerns/my_component/foo.rb` + ^^^^^^^^^ Cobra/ModelFilePlacement: Do not add top-level files into `app/models/concerns/`. Namespace them like `app/models/concerns/my_component/foo.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/presenter_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/presenter_file_placement_spec.rb index 9185e14e..53712491 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/presenter_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/presenter_file_placement_spec.rb @@ -25,7 +25,7 @@ it "when presenter is defined directly inside app/presenters/" do source = <<~RUBY class FooPresenter - ^^^^^^^^^^^^^^^^^^ Do not add top-level files into `app/presenters/`. Namespace them like `app/presenters/my_component/foo_presenter.rb` + ^^^^^^^^^^^^^^^^^^ Cobra/PresenterFilePlacement: Do not add top-level files into `app/presenters/`. Namespace them like `app/presenters/my_component/foo_presenter.rb` end RUBY @@ -37,7 +37,7 @@ class FooPresenter it "when presenter is defined directly inside mismatched subdirectory of app/presenters/" do source = <<~RUBY class FooPresenter - ^^^^^^^^^^^^^^^^^^ Do not add top-level files into `app/presenters/`. Namespace them like `app/presenters/my_component/other_namespace/foo_presenter.rb` + ^^^^^^^^^^^^^^^^^^ Cobra/PresenterFilePlacement: Do not add top-level files into `app/presenters/`. Namespace them like `app/presenters/my_component/other_namespace/foo_presenter.rb` end RUBY diff --git a/packages/rubocop-cobra/spec/rubocop/cop/cobra/view_component_file_placement_spec.rb b/packages/rubocop-cobra/spec/rubocop/cop/cobra/view_component_file_placement_spec.rb index 96f57072..44e74a16 100644 --- a/packages/rubocop-cobra/spec/rubocop/cop/cobra/view_component_file_placement_spec.rb +++ b/packages/rubocop-cobra/spec/rubocop/cop/cobra/view_component_file_placement_spec.rb @@ -31,7 +31,7 @@ it "when view_component is defined directly inside app/components/" do source = <<~RUBY class FooComponent < ::ViewComponent::Base - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Cobra/ViewComponentFilePlacement: Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` end RUBY @@ -43,7 +43,7 @@ class FooComponent < ::ViewComponent::Base it "when view_component is defined directly inside mismatched subdirectory of app/components/" do source = <<~RUBY class FooComponent < ::ViewComponent::Base - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Cobra/ViewComponentFilePlacement: Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` end RUBY @@ -55,7 +55,7 @@ class FooComponent < ::ViewComponent::Base it "when view_component is defined directly inside mismatched subdirectory of app/components/" do source = <<~RUBY class FooComponent < ::ViewComponent::Base - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Cobra/ViewComponentFilePlacement: Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` end RUBY @@ -67,7 +67,7 @@ class FooComponent < ::ViewComponent::Base it "when view_component is defined within directory of component name, but not in an additional subdirectory" do source = <<~RUBY module MyComponent - ^^^^^^^^^^^^^^^^^^ Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` + ^^^^^^^^^^^^^^^^^^ Cobra/ViewComponentFilePlacement: Nest ViewComponent definitions in the parent component and resource namespace. For example: `app/components/my_component//foo_component.rb` class FooComponent < MyComponent::ApplicationComponent end end