From 40f024b477b66eca290fff0b46e34c10834e6768 Mon Sep 17 00:00:00 2001 From: Rodin Date: Wed, 6 May 2026 16:33:21 -0700 Subject: [PATCH] fix: update drifted source citations to match current upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verified all 17 file:line citations against elixir-lang/elixir HEAD. Fixed 10 citations where line numbers had shifted due to upstream changes: - patterns/genserver.md: agent.ex:246 → 279 (start_link spec) - patterns/process-design.md: task.ex:282 → 327 (child_spec) - smells/anti-patterns.md: registry_test.exs:28 → 29, gen_server_test.exs:166 → 164, test_helper.exs:98 → 99 - smells/common-mistakes.md: registry_test.exs:28 → 29, callbacks.ex:423 → 433, task_test.exs:297,305,315,330 → 300,308,316,327, supervisor_test.exs:278 → 289, callbacks.ex:277 → 520 --- patterns/genserver.md | 2 +- patterns/process-design.md | 2 +- smells/anti-patterns.md | 6 +++--- smells/common-mistakes.md | 10 +++++----- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/patterns/genserver.md b/patterns/genserver.md index 327ef19..05046b0 100644 --- a/patterns/genserver.md +++ b/patterns/genserver.md @@ -289,7 +289,7 @@ def start_link(default) when is_binary(default) do GenServer.start_link(__MODULE__, default) end -# From agent.ex:246 +# From agent.ex:279 @spec start_link((-> term), GenServer.options()) :: on_start def start_link(fun, options \\ []) when is_function(fun, 0) do GenServer.start_link(Agent.Server, fun, options) diff --git a/patterns/process-design.md b/patterns/process-design.md index 6e0cfd7..8bf44e4 100644 --- a/patterns/process-design.md +++ b/patterns/process-design.md @@ -457,7 +457,7 @@ Supervisor.init(children, **Code example from source:** ```elixir # Task defaults to :temporary — intentional one-shot work -# (from task.ex:282) +# (from task.ex:327) def child_spec(arg) do %{ id: Task, diff --git a/smells/anti-patterns.md b/smells/anti-patterns.md index 4a02d97..a059b1a 100644 --- a/smells/anti-patterns.md +++ b/smells/anti-patterns.md @@ -84,7 +84,7 @@ end) **What they avoid:** Tests that depend on or modify global state without cleanup. -**Source evidence:** `lib/mix/test/test_helper.exs:98-113` — MixTest.Case restores ALL global state in `on_exit`: +**Source evidence:** `lib/mix/test/test_helper.exs:99-115` — MixTest.Case restores ALL global state in `on_exit`: - `Mix.env(:dev)`, `Mix.target(:host)`, `Mix.Task.clear()`, `Mix.Shell.Process.flush()` - Unloads all applications that were loaded during the test @@ -587,12 +587,12 @@ end **What they avoid:** ETS tables, registered names, or application env used across tests without isolation. -**Source evidence:** `lib/elixir/test/elixir/registry_test.exs:28-31` — Each test gets a uniquely-named Registry: +**Source evidence:** `lib/elixir/test/elixir/registry_test.exs:29-32` — Each test gets a uniquely-named Registry: ```elixir name = :"#{config.test}_#{partitions}_#{inspect(keys)}" ``` -`lib/elixir/test/elixir/gen_server_test.exs:166` — Uses `%{test: name}` for unique process registration. +`lib/elixir/test/elixir/gen_server_test.exs:164` — Uses `%{test: name}` for unique process registration. **Why it's bad:** Tests that share state can't run concurrently. They're order-dependent and fragile. diff --git a/smells/common-mistakes.md b/smells/common-mistakes.md index 52e2c9b..b8d8470 100644 --- a/smells/common-mistakes.md +++ b/smells/common-mistakes.md @@ -91,7 +91,7 @@ setup do end ``` -**Source:** `lib/ex_unit/lib/ex_unit/callbacks.ex:277-340` — `start_supervised` is designed specifically for this: guaranteed shutdown in reverse order, no leaked processes, no race conditions. +**Source:** `lib/ex_unit/lib/ex_unit/callbacks.ex:520-568` — `start_supervised` is designed specifically for this: guaranteed shutdown in reverse order, no leaked processes, no race conditions. ### When to Apply This Rule @@ -236,7 +236,7 @@ test "starts a server", %{test: test_name} do end ``` -**Source:** `lib/elixir/test/elixir/registry_test.exs:28` — `name = :"#{config.test}_#{partitions}_#{inspect(keys)}"` — always derives unique names from test context. +**Source:** `lib/elixir/test/elixir/registry_test.exs:29` — `name = :"#{config.test}_#{partitions}_#{inspect(keys)}"` — always derives unique names from test context. ### When to Apply This Rule @@ -474,7 +474,7 @@ describe "admin users - deletion" do end ``` -**Source:** `lib/ex_unit/lib/ex_unit/callbacks.ex:423-425` — `no_describe!` check prevents nesting. +**Source:** `lib/ex_unit/lib/ex_unit/callbacks.ex:433-437` — `no_describe!` check prevents nesting. ### When to Apply This Rule @@ -628,7 +628,7 @@ test "handles process crash" do end ``` -**Source:** `lib/elixir/test/elixir/task_test.exs:297,305,315,330` — Every test that expects a linked process to crash sets `:trap_exit` first. +**Source:** `lib/elixir/test/elixir/task_test.exs:300,308,316,327` — Every test that expects a linked process to crash sets `:trap_exit` first. ### When to Apply This Rule @@ -866,7 +866,7 @@ test "process stops" do end ``` -**Source:** `lib/elixir/test/elixir/supervisor_test.exs:278-285` — `assert_kill` helper always uses monitor + assert_receive, never `Process.alive?` polling. +**Source:** `lib/elixir/test/elixir/supervisor_test.exs:289-293` — `assert_kill` helper always uses monitor + assert_receive, never `Process.alive?` polling. ### When to Apply This Rule