-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False-positive in Rails/HttpPositionalArguments #532
Labels
bug
Something isn't working
Comments
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Sep 2, 2021
…ents` Fixes rubocop#532. This PR fixes a false positive for `Rails/HttpPositionalArguments` when defining `get` in `Rails.application.routes.draw` block.
9 tasks
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Sep 3, 2021
…ents` Fixes rubocop#532. This PR fixes a false positive for `Rails/HttpPositionalArguments` when defining `get` in `Rails.application.routes.draw` block.
koic
added a commit
that referenced
this issue
Sep 4, 2021
…osisional_arguments [Fix #532] Fix a false positive for `Rails/HttpPositionalArguments`
smcabrera
added a commit
to smcabrera/rubocop-rails
that referenced
this issue
Dec 27, 2022
This PR rubocop@732a0db This issue was reported a while back finding that the HTTP positional arguments cop could give false positives rubocop#532 I found another instance of false positives when the `append` method is used instead of `draw` or `routes`. If we add that to the list as well this problem seems to go away.
9 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When routes are defined in controller specs, they might use the same method manes as this cop checks. We probably have to determine is we are inside of the
Rails.application.routes.draw do
orroutes do
block (the latter one is provided by rspec) and ignore HTTP verb method calls there.Expected behavior
I expect the cop to ignore HTTP method request helpers invocation inside of routes definitions.
Actual behavior
Rails/HttpPositionalArguments
catches route definition helpers invocation and raises an offense.Steps to reproduce the problem
Produces:
RuboCop version
The text was updated successfully, but these errors were encountered: