Low
Ruby
Use frozen string literals
Official
Rule Description
Add `# frozen_string_literal: true` to the top of Ruby files:
- Prevents accidental string mutation
- Improves memory usage and performance
- Catches bugs where strings are mutated unexpectedly
Configure RuboCop to enforce this automatically.
Add This Rule
Sign in to add this rule to your workspace
Sign in with GitHubDetails
- Severity
- Low
- Category
- Ruby
- Used in
- 3 rulesets