fix: log each file path in verbose mode#815
Draft
kimjune01 wants to merge 2 commits into
Draft
Conversation
Addresses issue tconbeer#384 by adding log output before attempting to read each file when the --verbose flag is used. This helps users identify which file caused an error, especially when processing many files. Previously, verbose mode only showed files after they were processed. Now it prints "Reading <filepath>" before processing each file, making it easier to diagnose encoding errors or other file-specific issues (as reported in tconbeer#383). The implementation: - Adds a print statement in _format_one() before reading the file - Uses relative paths when possible for cleaner output - Only prints when mode.verbose is True - Works in both single-process and multiprocess modes Test added to verify verbose logging shows file paths being processed.
The test asserted "Reading" or "Processing" in stderr, but the code only emits "Reading". The "Processing" branch was dead and weakened the test.
Author
|
Cannot validate on current setup, so drafting. Please close or take it over. |
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
display_output(f"Reading {display_path}")call in_format_onewhen verbose mode is enabled, so users can see which file is being processeddisplay_outputto avoid circular importsFixes #384
Test plan
pytest tests/ -vpasses (1230 tests, 2 deselected for pre-existing env issue)test_verbose_loggingverifies that--verbose --check --no-progressbar --single-processprints "Reading" and at least one SQL file name to stderr