Skip to content
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

Add Rails/HashKeyValueRoute cop #1329

Closed
wants to merge 1 commit into from

Conversation

r7kamura
Copy link
Contributor

This is a cop for the routing style deprecated by the following pull request:


Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.
  • If this is a new cop, consider making a corresponding update to the Rails Style Guide.

@r7kamura r7kamura force-pushed the hash-key-value-route branch 2 times, most recently from 2dde4fa to 97b85d7 Compare August 14, 2024 06:28
module RuboCop
module Cop
module Rails
# Avoid Hash key-value routing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add the deprecation from 7.2 as a rational for this cop? This is very sparse.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I've added a little more explanation based on the Rails' deprecation message.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's good, thanks! And my bad, it'll only be deprecated in 8.0 (removed in 8.1) like you correctly wrote.

@zzak
Copy link

zzak commented Aug 31, 2024

FYI, it was reverted in rails/rails@5c0b749

@koic
Copy link
Member

koic commented Oct 20, 2024

As shown in the information provided by @zzak, the deprecation was reverted. Since the reason for prioritizing this syntax is now unclear, I will close this. Thank you for opening this PR.

@koic koic closed this Oct 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants