Given the test file
puts 'Hello'
when using RuboCop defaults
and running
$ rubocop -a test.rb
then it should insert a frozen string literal comment.
The test file is left unchanged. Output:
$ rubocop -a test.rb
Inspecting 1 file
C
Offenses:
test.rb:1:1: C: Style/FrozenStringLiteralComment: Missing frozen string literal comment.
puts 'Hello'
^
1 file inspected, 1 offense detected
$ [bundle exec] rubocop -V
0.88.0 (using Parser 2.7.1.4, rubocop-ast 0.1.0, running on ruby 2.5.8 x86_64-linux)
The rubocop -a option behaviour has been changed from RuboCop 0.87.
https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md#changes-2
Can you use rubocop -A or rubocop --auto-correct-all instead, for Style/FrozenStringLiteralComment unsafe cop?
https://docs.rubocop.org/rubocop/0.88/usage/auto_correct.html
Thank you.
It would be nice if the potentially correctable offenses was shown; I opened #8362
Most helpful comment
It would be nice if the potentially correctable offenses was shown; I opened #8362