From f595b910308b6e6e5571294fca82e9ded90abdde Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Wed, 6 May 2026 17:17:10 -0700 Subject: [PATCH] fix: update drifted citation line numbers - option_parser.ex: String.to_existing_atom/1 is at line 859, not 855 (line 855 is the String.to_atom clause for allow_nonexistent_atoms) - logger test_helper.exs: capture_log after clause spans lines 57-65, not 57-62 (the 'after' keyword is at line 64, restore at line 65) --- smells/anti-patterns.md | 2 +- smells/common-mistakes.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smells/anti-patterns.md b/smells/anti-patterns.md index a059b1a..aa71410 100644 --- a/smells/anti-patterns.md +++ b/smells/anti-patterns.md @@ -880,7 +880,7 @@ end **What they avoid:** Converting untrusted strings to atoms. -**Source evidence:** `lib/elixir/lib/option_parser.ex:855` — Uses `String.to_existing_atom/1` with the `:switches` allowlist pattern. The only `String.to_atom/1` calls in library code are in compiler/macro contexts where the set is bounded. +**Source evidence:** `lib/elixir/lib/option_parser.ex:859` — Uses `String.to_existing_atom/1` with the `:switches` allowlist pattern. The only `String.to_atom/1` calls in library code are in compiler/macro contexts where the set is bounded. **Why it's bad:** Atoms are never garbage collected. User-controlled atom creation is a denial-of-service vector (1,048,576 atom limit by default). diff --git a/smells/common-mistakes.md b/smells/common-mistakes.md index b8d8470..31f6e0e 100644 --- a/smells/common-mistakes.md +++ b/smells/common-mistakes.md @@ -401,7 +401,7 @@ setup do end ``` -**Source:** `lib/logger/test/logger_test.exs:12-17` — Every Logger config change has a corresponding `on_exit` restoration. `lib/logger/test/test_helper.exs:57-62` — `capture_log` uses `after` to always restore level. +**Source:** `lib/logger/test/logger_test.exs:12-17` — Every Logger config change has a corresponding `on_exit` restoration. `lib/logger/test/test_helper.exs:57-65` — `capture_log` uses `after` to always restore level. ### When to Apply This Rule