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/TopLevelHashWithIndifferentAccess cop #752

Merged
merged 1 commit into from
Jul 29, 2022

Conversation

r7kamura
Copy link
Contributor

@r7kamura r7kamura commented Jul 28, 2022

As explained at Rails Guides, the top-level HashWithIndifferentAccess has been soft-deprecated since Rails 5.1.

6.1 Top-level HashWithIndifferentAccess is soft-deprecated

If your application uses the top-level HashWithIndifferentAccess class, you should slowly move your code to instead use ActiveSupport::HashWithIndifferentAccess.

It is only soft-deprecated, which means that your code will not break at the moment and no deprecation warning will be displayed, but this constant will be removed in the future.

I would like to add the cop for this deprecation.


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.
    • This is exaplained at the Rails Guides, so it doesn't need to do it I think.

@r7kamura r7kamura force-pushed the feature/top-lavel-hash branch 2 times, most recently from bdef4c4 to 8f8aa10 Compare July 29, 2022 00:01
@koic koic merged commit e007571 into rubocop:master Jul 29, 2022
@r7kamura r7kamura deleted the feature/top-lavel-hash branch July 29, 2022 20:01
koic added a commit that referenced this pull request Jul 30, 2022
koic added a commit that referenced this pull request Jul 30, 2022
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.

3 participants