Download this file
| 1 | package guards |
| 2 | |
| 3 | import ( |
| 4 | "strings" |
| 5 | "testing" |
| 6 | ) |
| 7 | |
| 8 | // preMoveRastrillo is rastrillo's module path before it moved to |
| 9 | // amadan.net/rastrillo/rastrillo (2026-08-31). Nothing after v0.23.0 was |
| 10 | // released under it, so code importing it gets no rastrillo fix — which |
| 11 | // is how Home's sign-in field kept zooming iOS on every tap for a month |
| 12 | // after rastrillo fixed it (polish audit r3, item 1). |
| 13 | // |
| 14 | // estilo still imports it (chrome's SafeReturn), so it stays in go.mod as |
| 15 | // an indirect requirement until estilo moves. Home's own code never may. |
| 16 | const preMoveRastrillo = "github.com/carlosframework/rastrillo" |
| 17 | |
| 18 | // TestNoPreMoveRastrillo fails on any import of rastrillo's old module |
| 19 | // path, in any of Home's modules. |
| 20 | func TestNoPreMoveRastrillo(t *testing.T) { |
| 21 | root := repoRoot(t) |
| 22 | for _, path := range goFiles(t, root) { |
| 23 | for _, imp := range fileImports(t, path) { |
| 24 | if imp == preMoveRastrillo || strings.HasPrefix(imp, preMoveRastrillo+"/") { |
| 25 | t.Errorf("%s: imports %q, rastrillo's frozen pre-move path; use amadan.net/rastrillo/rastrillo", relPath(t, root, path), imp) |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | |