Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preprocess/links: fail for invalid links #2277

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

toxeus
Copy link

@toxeus toxeus commented Dec 29, 2023

Before, mdbook would continue processing even when errors, such as invalid links, are encountered. Moreover, it would exit with a 0 return code. Such behavior is unexpected and leads to confusion when run in CI.

Now, when links that don't point to existing files are encounter and error is returned which yields to mdbook exiting with an error code. The change in behavior has revealed that some tests were run with invalid links.

Closes #1094

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Dec 29, 2023
Before, `mdbook` would continue processing even when
errors, such as invalid links, are encountered. Moreover,
it would exit with a `0` return code. Such behavior is
unexpected and leads to confusion when run in CI.

Now, when links that don't point to existing files are
encounter and error is returned which yields to `mdbook`
exiting with an error code. The change in behavior has
revealed that some tests were run with invalid links.
@conorsch
Copy link

Took this branch for a spin, and worked well: my existing mdbook docroot with broken links threw an error, as I'd expected. After patching the include, no more errors. I support this change being merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: waiting on a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include directives to missing files do not return error
3 participants