Skip to content

Commit

Permalink
[Fix #7287] FrozenStringLiteralComment is unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
buehmann authored and bbatsov committed Jan 2, 2020
1 parent 2c0eec6 commit 1d0b497
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
* [#7607](https://github.com/rubocop-hq/rubocop/issues/7607): Fix `Style/FrozenStringLiteralComment` infinite loop when magic comments are newline-separated. ([@pirj][])
* [#7602](https://github.com/rubocop-hq/rubocop/pull/7602): Ensure proper handling of Ruby 2.7 syntax. ([@drenmi][])

### Changes

* [#7287](https://github.com/rubocop-hq/rubocop/issues/7287): `Style/FrozenStringLiteralComment` is now considered unsafe. ([@buehmann][])

## 0.78.0 (2019-12-18)

### New features
Expand Down
3 changes: 2 additions & 1 deletion config/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2758,7 +2758,7 @@ Style/FrozenStringLiteralComment:
to help transition to frozen string literals by default.
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.69'
VersionChanged: '0.79'
EnforcedStyle: always
SupportedStyles:
# `always` will always add the frozen string literal comment to a file
Expand All @@ -2769,6 +2769,7 @@ Style/FrozenStringLiteralComment:
# `never` will enforce that the frozen string literal comment does not
# exist in a file.
- never
Safe: false

Style/GlobalVars:
Description: 'Do not introduce global variables.'
Expand Down
2 changes: 1 addition & 1 deletion manual/cops_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2271,7 +2271,7 @@ EnforcedStyle | `annotated` | `annotated`, `template`, `unannotated`

Enabled by default | Safe | Supports autocorrection | VersionAdded | VersionChanged
--- | --- | --- | --- | ---
Enabled | Yes | Yes | 0.36 | 0.69
Enabled | No | Yes | 0.36 | 0.79

This cop is designed to help you transition from mutable string literals
to frozen string literals.
Expand Down

0 comments on commit 1d0b497

Please sign in to comment.