Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/check-agda-citations.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <echo-types checkout>
# 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,
Expand All @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down