Skip to content

fix: Elixir 1.20.1 compatibility (pin operator in size/1, credo 1.7.19) - #34

Merged
toshi0806 merged 1 commit into
mainfrom
fix-elixir-1.20-compat
Jun 16, 2026
Merged

fix: Elixir 1.20.1 compatibility (pin operator in size/1, credo 1.7.19)#34
toshi0806 merged 1 commit into
mainfrom
fix-elixir-1.20-compat

Conversation

@toshi0806

Copy link
Copy Markdown
Member

背景

共有 CI ワークフローの latest を OTP 29.0.2 / Elixir 1.20.1 へ更新(smkwlab/.github#65)し、本リポも @v1 追従(#32)した結果、Code Quality ジョブが Elixir 1.20.1 で失敗することが判明したため対応する。

変更内容

1. pin operator(lib/elixir_dnstap/frame_streams.ex 3箇所)

Elixir 1.20 から、match の外(関数ヘッド)で束縛した変数を bitstring の size(...) 内で使う場合に pin operator ^ が必須に(未対応だと警告 → --warnings-as-errors でエラー)。

# L155 / L196 / L229
<<payload::binary-size(^length), remaining::binary>> = rest
<<control_payload::binary-size(^control_length), remaining::binary>> = rest
<<content_type::binary-size(^length), _::binary>> = rest

いずれも関数ヘッドで束縛済みの値を使うため挙動は不変。

2. credo 1.7.12 → 1.7.19(mix.lock

credo 1.7.12 は Elixir 1.20.1 で @moduledoc の検出に失敗し、ほぼ全モジュールに対し「Modules should have a @moduledoc tag」を false positive(23件)として報告していた。1.7.18 の「Fix compatibility & compiler warnings with Elixir 1.20」で解消されるため最新 1.7.19 へ更新。

検証(ローカル、Elixir 1.20.1 / OTP 29)

  • mix compile --warnings-as-errors
  • mix credo --strict ✅(false positive 解消・no issues)
  • mix test
  • commit 時の Lefthook(format / tests / credo)も全 pass ✅

@toshi0806
toshi0806 merged commit 7911171 into main Jun 16, 2026
4 checks passed
@toshi0806
toshi0806 deleted the fix-elixir-1.20-compat branch June 16, 2026 02:29
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.

1 participant