I'm newbie in Rails. I am using 'Rubocop' for checking standards, however I'm bothered with the way it checks the 'frozen string literal'. It keeps on saying on my files:
Missing frozen string literal comment.
Is there a way to disable the checking of this on rubocop? Or is it a bad idea to disable it?
I tried this on rubocop.yml but didn't work
frozen_string_literal: false
The property can be found here: FrozenStringLiteral. This change just silences the warning. The linked page describes the right solution: Add the frozen_string_literal comment to the top of files to help transition to frozen string literals by default. .
Starting with Ruby 2.3, if you add the magic comment # frozen_string_literal: true to the file, the string literal for greeting is then automatically frozen (meaning it can't be modified). This means that if name is present and we try to personalize the greeting, a runtime error will be raised.
This one worked for me
Style/FrozenStringLiteralComment: Enabled: false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With