Skip to content

Commit d284905

Browse files
committed
Point README source links at v1.2.0 and guard against staleness
1 parent 062ee56 commit d284905

2 files changed

Lines changed: 49 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Localize ships a [Claude Code](https://claude.com/claude-code) skill that teache
5959
/plugin install localize@localize
6060
```
6161

62-
The skill source lives in [skills/localize](https://github.com/elixir-localize/localize/blob/v1.1.1/skills/localize/SKILL.md).
62+
The skill source lives in [skills/localize](https://github.com/elixir-localize/localize/blob/v1.2.0/skills/localize/SKILL.md).
6363

6464
## MCP server
6565

@@ -364,4 +364,4 @@ Locale-aware Phoenix LiveView inputs, so a user can enter a value under their ow
364364

365365
## License
366366

367-
Apache License 2.0, together with the Unicode License v3 for the CLDR and UCD data embedded in the package. See the [LICENSE](https://github.com/elixir-localize/localize/blob/v1.1.1/LICENSE.md) file for details, including which Unicode data is used and what it becomes.
367+
Apache License 2.0, together with the Unicode License v3 for the CLDR and UCD data embedded in the package. See the [LICENSE](https://github.com/elixir-localize/localize/blob/v1.2.0/LICENSE.md) file for details, including which Unicode data is used and what it becomes.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
defmodule Localize.ReadmeLinksTest do
2+
@moduledoc """
3+
The README's links to source files carry the version in their path, and
4+
nothing regenerates them — unlike the `mix.exs` package links, which
5+
interpolate `@version`. They were left pointing at the previous release
6+
twice in a row, once serving a LICENSE that predated the change the release
7+
was about, so the check is here rather than in a reviewer's memory.
8+
9+
"""
10+
11+
use ExUnit.Case, async: true
12+
13+
@source_links ~r{https://github\.com/elixir-localize/localize/blob/v([0-9]+\.[0-9]+\.[0-9]+)/}
14+
15+
test "every versioned source link points at the current version" do
16+
version = Localize.MixProject.project()[:version]
17+
readme = File.read!(Path.join(__DIR__, "../../README.md"))
18+
19+
stale =
20+
@source_links
21+
|> Regex.scan(readme)
22+
|> Enum.map(fn [_match, pinned] -> pinned end)
23+
|> Enum.uniq()
24+
|> Enum.reject(&(&1 == version))
25+
26+
assert stale == [],
27+
"README links to v#{Enum.join(stale, ", v")} but the package is v#{version}. " <>
28+
"Update the blob/v… paths in README.md to v#{version}."
29+
end
30+
31+
test "guide and module links resolve to hexdocs rather than GitHub" do
32+
# A GitHub blob link drops the reader out of the rendered documentation
33+
# into raw markdown. Only genuine source files with no hexdocs page — the
34+
# licence, the skill definition — belong on GitHub.
35+
readme = File.read!(Path.join(__DIR__, "../../README.md"))
36+
37+
offenders =
38+
~r{https://github\.com/elixir-localize/localize/blob/v[0-9.]+/([^\s\)]+)}
39+
|> Regex.scan(readme)
40+
|> Enum.map(fn [_match, path] -> path end)
41+
|> Enum.reject(&(&1 in ["LICENSE.md", "skills/localize/SKILL.md"]))
42+
43+
assert offenders == [],
44+
"These README links go to GitHub but have a rendered hexdocs page: " <>
45+
Enum.join(offenders, ", ")
46+
end
47+
end

0 commit comments

Comments
 (0)