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/I18nLocaleTexts match for redirect_back #880

Merged
merged 1 commit into from
Dec 3, 2022

Conversation

bensheldon
Copy link
Contributor

@bensheldon bensheldon commented Dec 3, 2022

Rails/I18nLocaleTexts was introduced in #643 and matches on redirect_to; this PR extends the cop to also match on the similarly behaved redirect_back method.


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.

@@ -0,0 +1 @@
* [#880](https://github.com/rubocop/rubocop-rails/pull/880): Add Rails/I18nLocaleTexts match for redirect_back. ([@bensheldon][])
Copy link
Member

Choose a reason for hiding this comment

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

The following test fails.

% bundle exec rake spec
(snip)

rspec './spec/project_spec.rb[1:2:4:1:7]' # RuboCop Rails Project Changelog future entries For /Users/koic/src/github.com/rubocop/rubocop-rails/spec/../changelog/add_i18nlocaletext_match_for_redirect_back.md starts with `new_`, `fix_`, or `change_`

Can you rename this filename to changelog/change_add_i18nlocaletext_match_for_redirect_back.md?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Just renamed and force-pushed.

@koic koic merged commit 2775559 into rubocop:master Dec 3, 2022
@koic
Copy link
Member

koic commented Dec 3, 2022

Nice 👍

@bensheldon bensheldon deleted the locale_text-redirect_back branch December 3, 2022 19:29
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.

2 participants