Commit 39d2f186 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'frozen-string-docs' into 'master'

Update docs regarding frozen string

See merge request gitlab-org/gitlab-ce!22003
parents f8e8374b f6c02ee0
---
title: Update docs regarding frozen string
merge_request:
author: gfyoung
type: other
......@@ -364,8 +364,7 @@ Depending on the size of the String and how frequently it would be allocated
there's no guarantee it will.
Strings will be frozen by default in Ruby 3.0. To prepare our code base for
this eventuality, it's a good practice to add the following header to all
Ruby files:
this eventuality, we will be adding the following header to all Ruby files:
```ruby
# frozen_string_literal: true
......@@ -379,6 +378,9 @@ test = +"hello"
test += " world"
```
When adding new Ruby files, please check that you can add the above header,
as omitting it may lead to style check failures.
## Anti-Patterns
This is a collection of [anti-patterns][anti-pattern] that should be avoided
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment