Enforce frozen_string_literal: true - #589
Conversation
The default `EnforcedStyle` is `always`, which enforces that all files have a `# frozen_string_literal` comment, but doesn't care if it's `true` or `false`. `always_true` enforces `true`, which we want. Any existing files can simply be added to a TODO list or disable the cop.
This automated commit dumps the contents of the full RuboCop config. [dependabot skip]
|
I think this is problematic because we override If you have a file such as: # frozen_string_literal: false
a = "x"
a << "y"and run |
|
Hmmm... wouldn't that be fine, since the developer would have to triage it in their PR anyway? I think if we have that false, then the dev would have to manually add the comment, rather than the something like VS Code adding it automatically. |
|
Arguably, it was always possible to write that file without a comment, and run the autocorrect which would default to |
|
Ok, yeah, it's probably not a big deal, just feels a little off to label it as safe when it's not. |
|
Yeah, I agree. I tracked down the PR that originally made that change though, and it looks like it's intentional. |
The default
EnforcedStyleisalways, which enforces that all files have a# frozen_string_literalcomment, but doesn't care if it'strueorfalse.always_trueenforcestrue, which we want. Any existing files can simply be added to a TODO list or disable the cop.