diff --git a/AGENTS.md b/AGENTS.md index fe88818e4..99031fe40 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -74,13 +74,25 @@ redirect in `src/data/redirects.ts` does not satisfy the check. - Link to this site with relative paths (`/admin/config/site-config`), never `https://sourcegraph.com/docs/…` or `https://docs.sourcegraph.com/…`. -- To also probe the external links you added: +- main has hundreds of pre-existing findings. To see only the ones your + branch adds, as CI does, record the merge base with `--format json` and + pass it as `--baseline`; `--diff` does not filter findings, it only scopes + `--check-external` and the review comments to added lines: ```sh -pnpm run check links --check-anchors --check-self-links \ - --check-external --diff <(git diff -U0 origin/main) +base=$(git merge-base origin/main HEAD) +git worktree add --detach /tmp/docs-base "$base" +node dev/check-links.mjs --check-anchors --check-self-links --format json \ + --root /tmp/docs-base > /tmp/docs-base-links.json +git worktree remove /tmp/docs-base +git diff -U0 "$base" | pnpm run check links --check-anchors --check-self-links \ + --check-external --baseline /tmp/docs-base-links.json --diff /dev/stdin ``` +- Pipe the diff to `--diff /dev/stdin`, not `--diff <(git diff ...)`: + `dev/checks.mjs` spawns the check with only stdin/stdout/stderr, so the + process-substitution descriptor is gone and the check fails with `EBADF` + ### PR check comments The spelling, links, redirects, and example hostnames checks comment on the diff --git a/cspell-allow-list.txt b/cspell-allow-list.txt index d700988ac..4fdce36b5 100644 --- a/cspell-allow-list.txt +++ b/cspell-allow-list.txt @@ -182,6 +182,7 @@ drwxr dshm dumpall eastus +EBADF eksctl ELEC elif