Skip to content

NotInSummary wrongly reported if -f option is used #86

@marxin

Description

@marxin

I noticed that while debugging the https://rustc-dev-guide.rust-lang.org/ documentation that utilizes -f option for files modified against the master branch.

The problematic invocation:

❯ RUST_LOG=info ~/Programming/mdbook-linkcheck/target/debug/mdbook-linkcheck -f profile-guided-optimization.md -f SUMMARY.md -s 
[2024-07-23T15:46:06Z INFO  mdbook_linkcheck] Started the link checker
[2024-07-23T15:46:06Z INFO  mdbook_linkcheck] Scanning book for links
[2024-07-23T15:46:06Z INFO  mdbook_linkcheck] Found 9 links (0 incomplete links)
[src/validate.rs:86:22] file_names = [
    "profile-guided-optimization.md",
]
[src/validate.rs:95:13] resolved_link = "llvm-coverage-instrumentation.md"
[src/validate.rs:96:13] summary_path = "profile-guided-optimization.md"
error: It looks like "llvm-coverage-instrumentation.md" wasn't included in SUMMARY.md
   ┌─ profile-guided-optimization.md:52:1
   │
52 │ [`-C instrument-coverage`](./llvm-coverage-instrumentation.md), but using these
   │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It looks like "llvm-coverage-instrumentation.md" wasn't included in SUMMARY.md

error: Server returned 404 Not Found for https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps
    ┌─ profile-guided-optimization.md:130:4
    │
130 │ in [run-make tests][rmake-tests] (the relevant tests have `pgo` in their name).
    │    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Server returned 404 Not Found for https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps

[2024-07-23T15:46:06Z INFO  mdbook_linkcheck] 2 broken links found
Error: One or more incorrect links

The problem is that llvm-coverage-instrumentation.md is not included in file_names (contains only the filtered file) passed as argument to ensure_included_in_book. And thus the warning is triggered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions