Fix compilation warnings on modern Elixir#40
Open
gilbertwong96 wants to merge 1 commit into
Open
Conversation
- config/config.exs: replace deprecated use Mix.Config with import Config - lib/mix/tasks/pre_commit.ex: replace Application.get_env/2 at module body with Application.compile_env/3, supplying a default as the third argument - mix.exs: bump required Elixir version from ~> 1.2 to ~> 1.16, matching the value already documented in the @moduledoc and required to compile against modern Elixir/OTP - mix.lock: refresh transitive deps pulled in by mix deps
c2da5df to
5c65398
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves all compilation warnings emitted when building this project on modern Elixir/OTP. Verified with
mix compile --warnings-as-errorson Elixir 1.20 / OTP 29.Changes
config/config.exs— Replace deprecateduse Mix.Configwithimport Config(the Mix.Config macro has been deprecated since Elixir 1.11).lib/mix/tasks/pre_commit.ex— Replace module-bodyApplication.get_env/2calls withApplication.compile_env/3, supplying the previous|| defaultfallback as the third argument. Reading config at compile time viacompile_env/3is the recommended pattern and eliminates the "discouraged in the module body" warning.mix.exs— Bump required Elixir from~> 1.2to~> 1.16. The previous constraint was older than the~> 1.16value already documented in the@moduledoc, and~> 1.2no longer resolves cleanly on current Elixir releases.mix.lock— Refresh transitive deps (ex_doc,earmark_parser,makeup,makeup_elixir,makeup_erlang,nimble_parsec) thatmix depspulled in for the build.Verification
Notes
mix compilecome from inside deps (makeup,ex_doc) and are out of scope for this change.pre_commitMix task and the git pre-commit hook is unchanged — this is a refactor / build hygiene PR.Test plan
mix compileruns clean with no project warningsmix compile --warnings-as-errorsexits 0pre_commitconfig into a host project, commit a change, confirm pre-commit task still runs commands and halts correctly