Skip to content

Add "Allowed" to Rails/HttpPositionalArguments #1489

@wscourge

Description

@wscourge

Is your feature request related to a problem? Please describe.

I have the following RSpec config:

RSpec.configure do |config|
  config.filter_run_excluding :broken, :flaky, :slow
end

and the following test:

RSpec.describe "api/v1/contacts" do
  path "/api/v1/contacts" do
    get "contacts", broken: true do # <===== HERE
      response(200, "successful") do
        schema oneOf: [{ "$ref" => "#/components/schemas/contacts" }]

        run_test! do |response|
          expect(response).to have_http_status :ok
        end
      end
    end

is a violation and gets autocorrected to get "contacts", params: { broken: true } do.

Describe the solution you'd like

I want .rubocop.yml to respect

Rails/HttpPositionalArguments:
  Enabled: true
  Allowed:
    - broken
    - flaky
    - slow

Describe alternatives you've considered

I just don't use it and have no better idea

Rails/HttpPositionalArguments:
  Enabled: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions