Skip to content

Commit

Permalink
Update Elixir matrix and fix deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
garno committed Aug 7, 2024
1 parent 138fe49 commit 97aecd3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
strategy:
matrix:
include:
- elixir: '1.13'
otp: '23.3'
- elixir: '1.14'
otp: '25'
- elixir: '1.15'
otp: '26'
- elixir: "1.15"
otp: "26"
- elixir: "1.16"
otp: "26"
- elixir: "1.17"
otp: "27"

lint: lint

env:
Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
erlang 26.0.1
elixir 1.15.0-otp-26
erlang 27.0.1
elixir 1.17.2-otp-27
2 changes: 1 addition & 1 deletion lib/formex/builder.ex
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ defmodule Formex.Builder do

wrapper =
if struct_module.module_info(:exports)[:formex_wrapper] do
struct_module.formex_wrapper
struct_module.formex_wrapper()
else
Formex.BuilderType.Struct
end
Expand Down
2 changes: 1 addition & 1 deletion lib/formex/utils.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ defmodule Formex.Utils do
end

def implements?(module, behaviour) do
Enum.member?(module.module_info[:attributes][:behaviour], behaviour)
Enum.member?(module.module_info()[:attributes][:behaviour], behaviour)
end
end
4 changes: 2 additions & 2 deletions lib/formex/validator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ defmodule Formex.Validator do
@doc false
def translate_errors(form) do
translate_error =
form.type.translate_error || Application.get_env(:formex, :translate_error) ||
form.type.translate_error() || Application.get_env(:formex, :translate_error) ||
fn {msg, _opts} -> msg end

errors =
Expand All @@ -129,7 +129,7 @@ defmodule Formex.Validator do

@spec get_validator(form :: Form.t()) :: any
defp get_validator(form) do
form.type.validator || Application.get_env(:formex, :validator)
form.type.validator() || Application.get_env(:formex, :validator)
end

@spec valid?(Form.t()) :: boolean
Expand Down

0 comments on commit 97aecd3

Please sign in to comment.