Skip to content

site_check: typed findings and reported read errors (closes #13997) - #14007

Merged
TrapsterDK merged 1 commit into
mainfrom
site-check-typed-findings-13997
Nov 19, 2026
Merged

TrapsterDK merged 1 commit into
mainfrom
site-check-typed-findings-13997

Conversation

@TrapsterDK

Copy link
Copy Markdown
Collaborator

Closes #13997

site_check now returns typed findings, and it reports inputs it cannot read instead of ignoring them.

  • tools/docs/site/check/src/lib.rs: check() now returns Result<(), CheckError>. There is one variant per earlier refusal plus Read(PathIoError). Book, prose, api, shard and records reads all go through documentation_ir::tool::path_io, so a missing --book now reports cannot read … where it used to say "book has no title".
  • tools/docs/site/check/src/rendered.rs: check_rendered() now returns Vec<RenderedFinding> and asset() returns AssetError. pages() returns Result<_, PathIoError>. A page or search index that cannot be read becomes a Read finding, and so does a failed read during the --forbid scan (now in first_publisher).
  • The Display text is unchanged, so the stderr expectations in site_check_test.rs and rendered_site_test.rs were left as they are.
  • Tests: assertions now use matches! plus to_string(). New cases cover each unreadable input (book/api/guide/shard/records), a non-UTF-8 page, a non-UTF-8 search index, a missing root and a vanished page in the forbid scan.

Behaviour changes:

  • An input that is not UTF-8 now fails instead of being read as empty.
  • --rendered on a missing directory now prints cannot list ….

Verification (Linux, with the remote cache disabled because of a remote cache blob error):

  • tools/dx test //tools/docs/site/check:dx_site_check_test: passed.
  • tools/dx test //tools/docs/site:site_check_test //tools/docs/site:rendered_site_test //tools/docs/site:serve_test //tools/docs/site:deploy_smoke_test: 4 passed.
  • tools/dx check --affected: format and typecheck ok, with no diagnostics in this package.
    • Lint findings are only in files this PR does not touch.
    • Test failures are only in targets this PR does not touch: tools/api/api_test (Starlark API snapshot), toolchain_gate_test, and apple_consumer_test/go_consumer_test. The consumer and nested-Bazel tests are left to CI.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K

check() returns Result<(), CheckError> and check_rendered() returns
Vec<RenderedFinding>; asset() returns AssetError. Every input read goes
through documentation_ir::tool::path_io, so an unreadable book, prose,
api, shard, records file, rendered page or search index is reported
with its path instead of being read as empty. Display text is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hvgPbKqbuDgsTasg7K
@TrapsterDK
TrapsterDK force-pushed the site-check-typed-findings-13997 branch from 40edd42 to 736b182 Compare November 19, 2026 17:35
@TrapsterDK
TrapsterDK merged commit e19c82c into main Nov 19, 2026
@TrapsterDK
TrapsterDK deleted the site-check-typed-findings-13997 branch November 19, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rust: site_check returns typed findings and reports unreadable inputs (part of #13148)

1 participant