Skip to content

Fix warnings#33

Merged
folz merged 6 commits into
folz:masterfrom
greetingsfellowhumans:fix_warnings
Jul 4, 2026
Merged

Fix warnings#33
folz merged 6 commits into
folz:masterfrom
greetingsfellowhumans:fix_warnings

Conversation

@greetingsfellowhumans

Copy link
Copy Markdown
Contributor

Fixing some compiler warnings.

  1. Mix.Config is deprecated. But the config file was empty, so rather than switching it to import Config, I just removed the config file entirely.
  2. Enum.slice complains about negative ranges without specifiying the step. Added the step.
  3. Removed two tests because new (v1.20+) versions of elixir contain a typechecker that throws a warning about them (you can't call mod_inv/1 with a float). Incidentally, that seems to be the whole purpose of the test in the first place; to prove that passing the wrong type will raise an error. So I believe the new typechecker should actually replace such tests in the future. The function already contains guards to ensure this in older versions.

@folz

folz commented Jul 3, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4acfbb4c1a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/math.ex Outdated
control_points
|> Enum.with_index()
|> Enum.slice(0..-2)
|> Enum.slice(0..-2//1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep slice syntax compatible with supported Elixir

This package still declares elixir: "~> 1.4" in mix.exs, and .travis.yml explicitly tests Elixir 1.4.5 through 1.9.4, but the new stepped-range syntax (..//) was added in later Elixir releases. As a result, users and CI jobs on the declared supported versions cannot even parse this file, so fixing the warning for newer Elixir versions currently breaks older supported environments.

Useful? React with 👍 / 👎.

@folz folz left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Removing the config file is fine. Two things need changes before this can merge, both noted inline. They come down to the same thing: the project still supports Elixir 1.4 and up (mix.exs says ~> 1.4, and the Travis matrix runs 1.4.5 through 1.9.4), so the fixes have to keep working on those versions.

Comment thread lib/math.ex Outdated
Comment thread test/math_test.exs
greetingsfellowhumans and others added 2 commits July 4, 2026 09:38
Co-authored-by: Rodney Folz <github@rodneyfolz.com>
@folz
folz merged commit a05b5b6 into folz:master Jul 4, 2026
@folz

folz commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Looks great, accepted. Thank you for the PR!

@greetingsfellowhumans
greetingsfellowhumans deleted the fix_warnings branch July 4, 2026 17:44
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.

2 participants