diff --git a/scripts/check-agda-citations.sh b/scripts/check-agda-citations.sh index d611b90..7335e63 100755 --- a/scripts/check-agda-citations.sh +++ b/scripts/check-agda-citations.sh @@ -11,7 +11,7 @@ # # Usage: # scripts/check-agda-citations.sh extract -# Print the cited names found in src/, one per line, sorted. +# Print the cited names found in src/ (all subdirectories), one per line, sorted. # scripts/check-agda-citations.sh verify # Check that the fixture matches src/, and that every name in it is # declared in an .agda file of the checkout. Exit 0 when both hold, @@ -26,7 +26,7 @@ ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) FIXTURE="$ROOT/test/agda-citations.txt" extract() { - grep -ohE '`[A-Za-z][A-Za-z0-9]*(-[A-Za-z0-9]+)+`' "$ROOT"/src/*.jl \ + find "$ROOT/src" -type f -name '*.jl' -exec grep -ohE '`[A-Za-z][A-Za-z0-9]*(-[A-Za-z0-9]+)+`' {} + \ | tr -d '`' | LC_ALL=C sort -u } diff --git a/test/runtests.jl b/test/runtests.jl index ccf18f0..5c2f204 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -546,9 +546,9 @@ using Test cite = r"`([A-Za-z][A-Za-z0-9]*(?:-[A-Za-z0-9]+)+)`" srcdir = joinpath(@__DIR__, "..", "src") cited = Set{String}() - for f in readdir(srcdir; join = true) - endswith(f, ".jl") || continue - for m in eachmatch(cite, read(f, String)) + for (root, _, files) in walkdir(srcdir), name in files + endswith(name, ".jl") || continue + for m in eachmatch(cite, read(joinpath(root, name), String)) push!(cited, m.captures[1]) end end