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

Use frozen string literal in actionpack/ #29933

Merged
merged 1 commit into from Jul 29, 2017
Merged

Use frozen string literal in actionpack/ #29933

merged 1 commit into from Jul 29, 2017

Conversation

kirs
Copy link
Member

@kirs kirs commented Jul 25, 2017

Follow-up to #29655

Extends Style/FrozenStringLiteralComment rule to actionpack/.

The commit is just rubocop -a after updating the Rubocop config.

Note: like in #29897, I had to exclude .builder and .ruby test fixtures because using frozen string literal there leads to warnings:

actionpack/test/fixtures/respond_to/using_defaults.xml.builder:1: warning: `frozen_string_literal' is ignored after any tokens

Likely because Builder templates are eval'ed.

Related to:
#29728
#29819
#29732
#29896

@rails-bot
Copy link

r? @matthewd

(@rails-bot has picked a reviewer for you, use r? to override)

@kirs
Copy link
Member Author

kirs commented Jul 25, 2017

cc @rafaelfranca

CI looks good except those flaky actioncable and sqlite tests that have been popping for the past week.

@kirs
Copy link
Member Author

kirs commented Jul 29, 2017

@matthewd could you have a look? Thanks!

@@ -295,7 +297,7 @@ def log_error(exception)
return unless logger

logger.fatal do
message = "\n#{exception.class} (#{exception.message}):\n"
message = "\n#{exception.class} (#{exception.message}):\n".dup
Copy link
Contributor

Choose a reason for hiding this comment

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

According to rubocop/rubocop#4586 dup is not the fastest way.

Choose a reason for hiding this comment

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

@bdewater But that syntax is available from ruby 2.3 and above only, right ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, my bad!

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.

None yet

5 participants