Skip to content

Commit

Permalink
Run CI with --enable-frozen-string-literal
Browse files Browse the repository at this point in the history
Ensure the gem is compatible with it.

The only issues are in `parser.rb`, that's the only file that
doesn't enable frozen strings. I'm not sure if it was done on
purpose or not.
  • Loading branch information
byroot committed Apr 4, 2024
1 parent 5cc9966 commit 7a914f7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
ruby: [ head, 3.2 ]
ruby: [ head, '3.2', '3.3' ]
ruby-opt: [""]
include:
- ruby: "3.3"
ruby-opt: "--enable-frozen-string-literal --debug-frozen-string-literal"

steps:
- name: Install Protoc
Expand All @@ -24,5 +28,5 @@ jobs:

- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake
- name: Run tests ${{ matrix.rubyopt }}
run: bundle exec rake RUBYOPT="${{ matrix.rubyopt }}"
4 changes: 2 additions & 2 deletions lib/protoboeuf/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def eat_ws()
# bar_bif
# foo123
def read_ident
name = ''
name = +''

loop do
if eof?
Expand All @@ -745,7 +745,7 @@ def read_ident
# Read a string constant, eg:
# 'foobar'
def read_string
str = ''
str = +''

# The string must start with an opening quote
expect '"'
Expand Down

0 comments on commit 7a914f7

Please sign in to comment.