Modernize html-tidy CLI#16
Merged
Merged
Conversation
Bring tidy_output in line with the recently modernized compare-html CLI (compare_output_cli): - Rich-based CLI: live progress bar showing in-flight files transiently, keeping only findings visible, with a summary at the end. - Flat full-path output instead of the ASCII tree view. - Parallel tidy workers (-j/--max-workers); tidy/JSON validation runs in a ThreadPoolExecutor instead of a recursive, serial walk. - Degrade gracefully in CI / non-TTY: no live region, periodic heartbeat, and GitHub Actions ::error:: / ::warning:: annotations for findings. - Add -v/--verbose, --log-file, --log-file-verbosity logging options via the shared setup_logging helper, replacing the ad-hoc bcolors prints. - Add --details to print the full tidy / validator output per finding (previously tied to the old --verbose flag). - Split collection (collect_tasks) from execution so both live and plain runners share one code path, mirroring the compare CLI. - The tidy/JSON helpers now return (status, detail) instead of printing from inside worker threads, so parallel output no longer interleaves. Behavior change: invalid JSON is now reported as an error (fails the run) instead of a warning; a broken JSON file is not a benign warning. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AY3gNLvnBJNYEzhb8nNeqV
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.
Applies the same modernization the
compare-htmlCLI got in #14/#15 to thehtml-tidyentry point (tidy_output).What changed
Summaryrule at the end — replacing the ASCII tree view and rawbcolorsprints.-j/--max-workers; tidy/JSON validation now runs in aThreadPoolExecutorinstead of a recursive serial walk.::error::/::warning::annotations so findings surface in the Actions UI.-v/--verbose,--log-file,--log-file-verbosityvia the sharedsetup_logging.--detailsprints the full tidy / validator output per finding (this is what the old--verbosedid).collect_tasks(walk) from execution so live and plain runners share one path, mirroringcompare_output_cli.tidy_json/tidy_html/tidy_filehelpers now return(status, detail)instead of printing from worker threads, so parallel output no longer interleaves.Behavior change
Testing
pytestsuite passes (3 passed).--details,-j 4, empty dir, non-dir argument, clean-only (exit 0), andGITHUB_ACTIONS=trueannotations all verified.🤖 Generated with Claude Code