-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Remove frozen_string_literal comment from .arb templates
#8600
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8600 +/- ##
=======================================
Coverage 99.11% 99.11%
=======================================
Files 141 141
Lines 4076 4076
=======================================
Hits 4040 4040
Misses 36 36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
548e33d to
aeaa3e0
Compare
javierjulio
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! What's the reason that the .arb templates don't need the # frozen_string_literal: true comment?
Ah, it does not have effect (tested on arbre), so the warning is legitimate It has been highlighted here but I did not explicitly mentioned the reason in this commit message (I will reword): activeadmin/arbre@2bd6d87 I guess that
I'm not sure if this is a problem with rubocop itself, or it is left to the user to always exclude Edit:
yes, it looks so Maybe it is worth to mention @deivid-rodriguez , which is also the author of rubocop/rubocop#5591 |
aeaa3e0 to
eb4b117
Compare
|
I'm going to split this so we can merge and fix and leave the decision open for |
.arb templates, RuboCop, and frozen string literals
eb4b117 to
7ca9d82
Compare
82348f8 to
fe1e22d
Compare
.arb templates, RuboCop, and frozen string literals.arb templates, RuboCop, and frozen string literals - Pending new RuboCop release
.arb templates, RuboCop, and frozen string literals - Pending new RuboCop releasefrozen_string_literal comment from .arb - Pending new RuboCop release
9a726ef to
0c57b1b
Compare
frozen_string_literal comment from .arb - Pending new RuboCop releasefrozen_string_literal comment from .arb
The suggestion to add the `# frozen_string_literal: true` comment at the top of `.arb` files was a false positive for the following reasons: - It produced a warning. - It did not have any effect because `.arb` files are evaluated in a different context. To make this work correctly, the comment should be added at the framework level instead. This change eliminates the warning when running specs with `RUBYOPT="-w"`. Closes #8597 References: - rails/rails#43725 - rubocop/rubocop#13699
0c57b1b to
e7acb5f
Compare
frozen_string_literal comment from .arbfrozen_string_literal comment from .arb templates
The suggestion to add the
# frozen_string_literal: truecomment atthe top of
.arbfiles was a false positive for the following reasons:.arbfiles are evaluated in adifferent context.
To make this work correctly, the comment should be added at the
framework level instead.
This change eliminates the warning when running specs with
RUBYOPT="-w".Closes #8597
References:
# frozen_string_literal: truerails/rails#43725Style/FrozenStringLiteralCommentrubocop/rubocop#13699