Skip to content

Commit

Permalink
⬆️ Upgrade to Elixir 1.16 (#134)
Browse files Browse the repository at this point in the history
* ⬆️ Upgrade to Elixir 1.16

Elixir 1.11 is no longer supported, so remove from the CI matrix.

Update Credo to get some 1.16 fixes, which required disabling credo in a few places that now trigger false-positive rule violations. The functions in question are inlined in the `config-v6` branch, so this temporary override will go away soon.

* 🎨 Fix formatting issues

There were apparently some minor changes in Elixir 1.16's formatter.
  • Loading branch information
randycoulman authored Jan 10, 2024
1 parent 592f354 commit 7906b96
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 13 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/elixir-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ on:
workflow_dispatch:

env:
ELIXIR_VERSION: '1.15.x'
ELIXIR_VERSION: '1.16.x'
OTP_VERSION: '24.x'

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
elixir-version: ['1.11.x', '1.12.x', '1.13.x', '1.14.x', '1.15.x']
elixir-version: ['1.12.x', '1.13.x', '1.14.x', '1.15.x', '1.16.x']
steps:
- uses: actions/checkout@v2
- name: Set up Elixir
Expand Down Expand Up @@ -57,12 +57,7 @@ jobs:
- name: Run dialyzer
run: mix dialyzer

- name: Execute tests (Elixir 1.11.x)
if: matrix.elixir-version == '1.11.x'
run: mix coveralls.json

- name: Execute tests
if: matrix.elixir-version != '1.11.x'
run: mix coveralls.json --warnings-as-errors

- name: Upload coverage report
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.15.7-otp-26
elixir 1.16.0-otp-26
erlang 26.2
2 changes: 1 addition & 1 deletion lib/config_cat/cache_policy.ex
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ defmodule ConfigCat.CachePolicy do
@type lazy_options :: [{:cache_refresh_interval_seconds, non_neg_integer()}]

@typedoc "Callback to call when configuration changes."
@type on_changed_callback :: (() -> :ok)
@type on_changed_callback :: (-> :ok)

@typedoc false
@type option ::
Expand Down
2 changes: 1 addition & 1 deletion lib/config_cat/hooks.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ defmodule ConfigCat.Hooks do
```
"""
@type named_callback :: {module(), atom(), list()}
@type on_client_ready_callback :: (() -> any()) | named_callback()
@type on_client_ready_callback :: (-> any()) | named_callback()
@type on_config_changed_callback :: (Config.settings() -> any()) | named_callback()
@type on_error_callback :: (String.t() -> any()) | named_callback()
@type on_flag_evaluated_callback :: (EvaluationDetails.t() -> any()) | named_callback()
Expand Down
9 changes: 9 additions & 0 deletions lib/config_cat/rollout/comparator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ defmodule ConfigCat.Rollout.Comparator do
{:ok, false}
end

# These aren't actually predicates, but are inlined in the `config-v6` branch
# so will go away soon.
# credo:disable-for-next-line Credo.Check.Readability.PredicateFunctionNames
defp is_one_of(user_value, comparison_value) do
result =
comparison_value
Expand All @@ -128,6 +131,9 @@ defmodule ConfigCat.Rollout.Comparator do
{:ok, result}
end

# These aren't actually predicates, but are inlined in the `config-v6` branch
# so will go away soon.
# credo:disable-for-next-line Credo.Check.Readability.PredicateFunctionNames
defp is_one_of_semver(user_value, comparison_value) do
user_version = Version.parse!(user_value)

Expand All @@ -145,6 +151,9 @@ defmodule ConfigCat.Rollout.Comparator do
{:error, error}
end

# These aren't actually predicates, but are inlined in the `config-v6` branch
# so will go away soon.
# credo:disable-for-next-line Credo.Check.Readability.PredicateFunctionNames
defp is_one_of_sensitive(user_value, comparison_value) do
user_value
|> hash_value()
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defmodule ConfigCat.MixProject do
source_url: @source_url,
homepage_url: "https://configcat.com/",
version: "3.0.0",
elixir: "~> 1.10",
elixir: "~> 1.12",
description: description(),
package: package(),
elixirc_options: elixirc_options(Mix.env()),
Expand Down
4 changes: 2 additions & 2 deletions mix.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%{
"bunt": {:hex, :bunt, "0.2.1", "e2d4792f7bc0ced7583ab54922808919518d0e57ee162901a16a1b6664ef3b14", [:mix], [], "hexpm", "a330bfb4245239787b15005e66ae6845c9cd524a288f0d141c148b02603777a5"},
"bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"},
"certifi": {:hex, :certifi, "2.12.0", "2d1cca2ec95f59643862af91f001478c9863c2ac9cb6e2f89780bfd8de987329", [:rebar3], [], "hexpm", "ee68d85df22e554040cdb4be100f33873ac6051387baf6a8f6ce82272340ff1c"},
"credo": {:hex, :credo, "1.7.1", "6e26bbcc9e22eefbff7e43188e69924e78818e2fe6282487d0703652bc20fd62", [:mix], [{:bunt, "~> 0.2.1", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "e9871c6095a4c0381c89b6aa98bc6260a8ba6addccf7f6a53da8849c748a58a2"},
"credo": {:hex, :credo, "1.7.3", "05bb11eaf2f2b8db370ecaa6a6bda2ec49b2acd5e0418bc106b73b07128c0436", [:mix], [{:bunt, "~> 0.2.1 or ~> 1.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2 or ~> 1.0", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "35ea675a094c934c22fb1dca3696f3c31f2728ae6ef5a53b5d648c11180a4535"},
"dialyxir": {:hex, :dialyxir, "1.4.2", "764a6e8e7a354f0ba95d58418178d486065ead1f69ad89782817c296d0d746a5", [:mix], [{:erlex, ">= 0.2.6", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "516603d8067b2fd585319e4b13d3674ad4f314a5902ba8130cd97dc902ce6bbd"},
"earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"},
"elixir_uuid": {:hex, :elixir_uuid, "1.2.1", "dce506597acb7e6b0daeaff52ff6a9043f5919a4c3315abb4143f0b00378c097", [:mix], [], "hexpm", "f7eba2ea6c3555cea09706492716b0d87397b88946e6380898c2889d68585752"},
Expand Down

0 comments on commit 7906b96

Please sign in to comment.