-
Notifications
You must be signed in to change notification settings - Fork 44
Get tests passing with frozen-string-literals enabled. #30
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
Conversation
Hi Pat. Thanks for your contribution. I've checked your code and have couple suggestions:
|
a2225ae
to
a993d18
Compare
Thanks for the feedback Bernard. I've done the following:
|
Oh, and just to clarify from the line of code you highlighted: |
cdcae11
to
6bdd4ff
Compare
The Rubocop failures seem to be due to the version change (your last green build was using 0.47.1, the latest is 0.49.1) - the default preferences have changed. Would you prefer to lock the version dependency in the gemspec to 0.47.1, or should I just leave all this to you? :) Oh, and the |
The |
What a busy day you had! Thanks for hard work :)
|
Huh. Parser generates some of its Ruby files via Ragel, and those generated files aren't kept in source control. Makes sense, but means we can't rely on a git repo (it only worked in my testing because I'd generated the files locally while running its own test suite). That's annoying :| |
Yes, it is. We need to wait for merging your PR for parser, let's continue after that. |
Coming back to this PR after several months with some evolved thoughts: These days I'm actually preferring the pragma comment The catch is that it becomes something that needs to be remembered every time new files are introduced into the project - but removes the need for dependencies to be completely frozen-string-literal-friendly. In this project, given you're using Rubocop then you can have that enforce the pragma comment for future files. I'm happy to alter this PR to include the pragma comments and remove the Travis |
Sure, I'm kind of surprised that Rubocop didn't forced those. Please alter this PR and after passing tests (and fixing conflicts) I will merge it. |
The 3.7 releases are frozen-string-literal-friendly.
In the case of convert_args, let's return new objects, rather than modifying the input directly.
44f9c3d
to
834d4b0
Compare
Just force-pushed a new version of the branch based on your latest master. Makes for a better commit history, plus easier to merge :) One thing I've not done is update Rubocop. The latest is I'm guessing the version you're currently on doesn't enforce the pragma comments (whereas I've been using 0.52.1 on my own projects, and I know that it does). |
Awesome, thanks for your work! I will bump Rubocop version in separate PR, thanks for mentioning it. |
These changes ensure that all string literals can be frozen (as per the optional feature in MRI 2.3 and onwards). I would recommend adding the following to your
.travis.yml
file to ensure regressions aren't introduced:This will add the flag when the tests are run on MRI 2.4 or newer (while the feature was introduced in 2.3, it doesn't seem to work reliably until 2.4). Please note: this does require the latest commits for RSpec (particularly: rspec-core and rspec-support).