Skip to content

Support frozen strings #75

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Support frozen strings #75

wants to merge 3 commits into from

Conversation

npezza93
Copy link

No description provided.

net-scp.gemspec Outdated
@@ -35,15 +35,15 @@ Gem::Specification.new do |spec|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
spec.add_runtime_dependency(%q<net-ssh>, [">= 2.6.5", "< 8.0.0"])
spec.add_development_dependency(%q<test-unit>, [">= 0"])
spec.add_development_dependency(%q<mocha>, [">= 0"])
spec.add_dependency(%q<mocha>, [">= 0", "<2.1"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was it converted to non dev dependency?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, no idea. hah. Reverted

@robertcheramy
Copy link
Collaborator

Why should frozen-string-literals be enabled in the CI?
If we want to see the warnings about frozen string literals in the CI, we should use -W:deprecated and add ruby 3.4 as a target.

I also think it is better to have command = String.new('scp ') than the complicated test about the ruby version.

@npezza93
Copy link
Author

npezza93 commented Jan 14, 2025

Why should frozen-string-literals be enabled in the CI?

To catch any other places that would fail if frozen strings were enabled. And to also catch regressions

-W:deprecated

I think this just outputs warnings. In CI we would want actual failures.

Looks like the failures are due to net-ssh not yet supporting frozen strings

@robertcheramy
Copy link
Collaborator

This is not a good solution to fail all tests as long as Net::SCP didn't fix its frozen string literals, because no CI test will work and we will not be able to see if a PR is OK or not. Frozen string literals will only be default in Ruby 4.0, so we have no rush and out CI will fail against ruby-head as soon as it is make default there.

I propose not to enable frozen string literals, and to modify Rakefile to warn about them:

Rake::TestTask.new do |t|
  t.ruby_opts = ['-W:deprecated']
  t.libs = ["lib", "test"]
end

This way, we can see where there is work to do, and we still can use the CI to check against all ruby versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants