A guide for programming in style.
Ruby Swift Objective-C Haskell JavaScript Shell Other
Latest commit 5df1e8f Sep 7, 2016 @thorncp thorncp [Rubocop] Disable FrozenStringLiteralComment
RuboCop, somewhat recently, added the
[Style/FrozenStringLiteralComment][1] cop, which enforces the presence
of the `# frozen_string_literal: true` pragma at the top of every file,
when running in Ruby 2.3 mode. Hound recently [configured][2] RuboCop to
run in Ruby 2.3 mode by default. This means Hound will now comment on
any Ruby file touched in a PR that doesn't have the pragma, with:

> Missing frozen string literal comment.

This is intended to prepare code bases for Ruby 3.0, where strings will
be frozen by default. In practice, I find Hound making these comments to
be quite annoying, and I have disabled it on my current project.

It seems we can disable the cop, or start putting the pragma at the top
of all our files. The former seems easier so it's my pick.

[1]: bbatsov/rubocop#2542
[2]: houndci/linters#65



Guides for getting things done, programming well, and programming in style.

High level guidelines:

  • Be consistent.
  • Don't rewrite existing code to follow this guide.
  • Don't violate a guideline without a good reason.
  • A reason is good when you can convince a teammate.

A note on the language:

  • "Avoid" means don't do it unless you have good reason.
  • "Don't" means there's never a good reason.
  • "Prefer" indicates a better option and its alternative to watch out for.
  • "Use" is a positive instruction.


Please read the contribution guidelines before submitting a pull request.

In particular: if you have commit access, please don't merge changes without waiting a week for everybody to leave feedback.


Thank you, contributors!


Guides is maintained by thoughtbot, inc.


Guides is © 2014 thoughtbot, inc. It is distributed under the Creative Commons Attribution License.

The names and logos for thoughtbot are trademarks of thoughtbot, inc.