Honor strict warnings when using --quiet - #4153
Draft
itscloud0 wants to merge 2 commits into
Draft
Conversation
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.
Summary
Fixes #4126.
--quietpreviously raised themkdocslogger level toERROR, which meant build warnings never reached the strict-mode warning counter. This changes--quietto filter only the CLI stream handler, so warning records can still be counted while warning output remains quiet.Test Plan
uv run --python 3.11 --with-editable . python -m unittest mkdocs.tests.cli_tests.CLITests.test_build_quiet mkdocs.tests.cli_tests.CLITests.test_build_quiet_strict_counts_warnings mkdocs.tests.cli_tests.CLITests.test_build_strictuv run --python 3.11 --with-editable . python -m unittest mkdocs.tests.cli_testsuv run --python 3.11 --with black==23.12.1 black --check mkdocs/__main__.py mkdocs/tests/cli_tests.pyuv run --python 3.11 --with isort==5.13.2 isort --check-only --diff mkdocs/__main__.py mkdocs/tests/cli_tests.pyuv run --python 3.11 --with black==23.12.1 --with isort==5.13.2 --with ruff==0.1.14 ruff check mkdocs/__main__.py mkdocs/tests/cli_tests.py