Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt into Ruby frozen string literals throughout the codebase #446

Merged
merged 6 commits into from
May 27, 2024

Conversation

mattbrictson
Copy link
Owner

This PR adds the # frozen_string_literal: true comment to all of tomo's Ruby files.

This prepares tomo for a future version of Ruby (4?), where string literals will likely become frozen by default.

@mattbrictson mattbrictson added the 🏠 Housekeeping Non-user facing cleanup and maintenance label May 25, 2024
@mattbrictson mattbrictson marked this pull request as draft May 25, 2024 01:30
@mattbrictson mattbrictson marked this pull request as ready for review May 27, 2024 15:55
@mattbrictson mattbrictson added the automerge Automatically merge this PR once all required checks pass label May 27, 2024
@kodiakhq kodiakhq bot merged commit 1c055f5 into main May 27, 2024
8 checks passed
@kodiakhq kodiakhq bot deleted the frozen-literal branch May 27, 2024 16:09
kodiakhq bot pushed a commit that referenced this pull request Jun 22, 2024
When running `tomo deploy` in a multi-environment project with no
environment explicitly specified, tomo prompts:

```
Choose an environment: 
❯ staging
  production
```

Interacting with this menu with the keyboard would result in an error:

```
forwardable.rb:240:in 'String#clear': can't modify frozen String: "" (FrozenError)
	from forwardable.rb:240:in 'Tomo::Console::KeyReader#clear'
```

This is because the internal `buffer` used by `KeyReader` was frozen as
a side effect of #446.

Fix by marking `buffer` as mutable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge this PR once all required checks pass 🏠 Housekeeping Non-user facing cleanup and maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant