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

Deprecate IO.read warning in Newsletter exercise #1503

Merged
merged 2 commits into from
Jul 15, 2024

Conversation

lorisp1
Copy link
Contributor

@lorisp1 lorisp1 commented Jul 10, 2024

Hi, test close_log closes the file contained in Newsletter exercise is reporting the following warning if run with Elixir 1.17.1:

* test close_log closes the file [L#86]warning: IO.read(device, :all) is deprecated, use IO.read(device, :eof) instead
  (elixir 1.17.1) lib/io.ex:157: IO.read/2
  test/newsletter_test.exs:89: NewsletterTest."test close_log closes the file"/1
  (ex_unit 1.17.1) lib/ex_unit/runner.ex:485: ExUnit.Runner.exec_test/2
  (stdlib 5.2.3) timer.erl:270: :timer.tc/2
  (ex_unit 1.17.1) lib/ex_unit/runner.ex:407: anonymous fn/6 in ExUnit.Runner.spawn_test_monitor/4

This PR changes IO.read function call as suggested by the warning.

Copy link
Contributor

Thank you for contributing to exercism/elixir 💜 🎉. This is an automated PR comment 🤖 for the maintainers of this repository that helps with the PR review process. You can safely ignore it and wait for a maintainer to review your changes.

Based on the files changed in this PR, it would be good to pay attention to the following details when reviewing the PR:

  • General steps

    • 🏆 Does this PR need to receive a label with a reputation modifier (x:size/{tiny,small,medium,large,massive})? (A medium reputation amount is awarded by default, see docs)
  • Any exercise changed

    • 👤 Does the author of the PR need to be added as an author or contributor in <exercise>/.meta/config.json (see docs)?
    • 🔬 Do the analyzer and the analyzer comments exist for this exercise? Do they need to be changed?
    • 📜 Does the design file (<exercise>/.meta/design.md) need to be updated to document new implementation decisions?
  • Concept exercise changed

    • 🌲 Do prerequisites and practices in config.json need to be updated?
    • 📖 Does the concept introduction provide all necessary information to solve this exercise?
  • Concept exercise tests changed

    • ⚪️ Are all tests un-skipped?
    • 🔢 Are all tests annotated with @tag task_id?
    • 🐈 Can all tests be understood by reading the test's block only (e.g. no module attributes, no setup functions)?

Automated comment created by PR Commenter 🤖.

@angelikatyborska
Copy link
Contributor

Thanks!

@angelikatyborska
Copy link
Contributor

Ah, right, we can't just merge this because tests must work in many Elixir versions... @jiegillet thoughts?

@jiegillet
Copy link
Contributor

jiegillet commented Jul 10, 2024

The :eof value seems to have been inserted in 1.13, so 1.12 is failing.

Version 1.12 doesn't get security patches anymore, I can only assume that the timing for hard deprecation is linked to that. In that light, I think we could drop support for 1.12, if it's not officially safe, it makes sense for Exercism to discourage people using it.

@jiegillet
Copy link
Contributor

@lorisp1 could you rebase this on main? (or merge main)

@angelikatyborska angelikatyborska merged commit bb08999 into exercism:main Jul 15, 2024
9 checks passed
@angelikatyborska
Copy link
Contributor

Thanks again!

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