Repository navigation
Conversation
…uded pages (mkdocs#3900) When an included page links to an excluded page, the log level was always capped to INFO via `min(logging.INFO, ...)`, ignoring the user's configured `validation.links.not_found` level (e.g. `warn` or `error`). Remove the cap so the configured level is respected.
… pages test_draft_pages_with_invalid_links was written against the old capped behavior. The default not_found level is 'warn' (WARNING), so now that the min(INFO, …) cap is removed these messages correctly appear at WARNING level.
Author
|
The remaining CI failures ( The only tests my change affects are in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3900.
Problem
When an included page links to an excluded page, the warning level was computed as:
logging.INFOis20, so any level ≥WARNING(30) gets silently capped toINFO. This means settingvalidation.links.not_found: warn(orerror) has no effect for links pointing to excluded pages — the message always appears atINFO.The parallel branch for excluded-to-excluded links (a few lines above) correctly uses
logging.DEBUGwith no cap against the config value, so the inconsistency was unintentional.Fix
Remove the
min(logging.INFO, …)cap and use the configured level directly:Tests
Added
test_link_to_excluded_page_respects_not_found_levelwhich renders an included page that links to a file marked asInclusionLevel.EXCLUDEDand asserts the log record appears at the configured level (warn→WARNING,info→INFO). Before the fix, thewarnsub-test would fail because the log appeared atINFOinstead ofWARNING.