Repository navigation
[FIX] Route parser notices through the message target - #2473
harshalsp07 wants to merge 1 commit into
Conversation
cfsmp3
left a comment
There was a problem hiding this comment.
This is Carlos' claude doing the first pass. Before Carlos takes a look, please address these issues.
The problem is real: with --stdout, the notice ends up in the subtitle stream.
-
Follow
messages_targetinstead of always using stderr. The parser already tracks where messages go:Stdoutby default,Stderrwith--stdout(parser.rs~1012),Quietwith--quiet. Please print according to that (stdout, stderr or nothing) rather than hardcodingeprintln!, so this notice goes to the same place as every other message in the run. -
Other parse-time notices have the same bug. These also use
println!and land in the subtitles with--stdout:process_word_file(): "Word in line {num} too long…" (--capfile/--profanity-filewith--stdout)- "Request to extract chapters recieved." and the two lines after it (
--chapters) - "Output format is changed to bin" / "Input format is changed to bin"
Please route them the same way, so
--stdoutoutput only ever contains subtitles. A small helper that prints according tomessages_targetwould cover all of them. -
Please remove the CTest/Python additions (
src/CMakeLists.txtblock,tests/test_cli_webvtt_stdout.py,tests/samples/cli_output.scc). Nothing definesBUILD_TESTING(noinclude(CTest)/enable_testing()), and CI doesn't runctest, so none of it ever runs. A Rust unit test on the helper is enough.
98071aa to
a7fd3de
Compare
CCExtractor CI platform finished running the test files on windows. 90/238 tests matched the approved output:
148 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10101, commit 81bc1d0:
Pass there, fail here:
Fail on both but produce different output — behaviour moved even though the verdict did not:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10101), so the comparison above already covers it. This branch changes the behaviour of 110 test(s) relative to the tip of master. Those are the ones worth looking at; anything else in the list fails the same way on both sides. |
CCExtractor CI platform finished running the test files on linux. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10106, commit 7f5fe41:
Fail there, pass here:
Compared with the commit this branch was cut from — test 10110, commit 31264a1:
Fail on both but produce different output — behaviour moved even though the verdict did not:
Fail there, pass here:
No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
a7fd3de to
e54ea3a
Compare
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
The WebVTT encoding notice goes into the subtitle stream when
--stdoutis used. Route it throughmessages_targetalong with the chapter, word-list, and binary-format notices. They go to stdout by default, stderr with--stdout, and nowhere with--quiet.Reproduce with the existing SCC fixture. Sample
build/ccextractor tests/samples/scc_23_976.scc --webvtt --latin1 --stdout --no-bom > output.vttWith the fix,
output.vttstarts withWEBVTTand the UTF-8 notice appears on stderr. Add--quietto suppress the notice.The Rust unit test checks all three destinations. On Linux, all 24 WebVTT encoding cases passed. CLI checks also covered chapter notices, both word-file warnings, and the TCP input-format notice. Subtitle bytes matched master after accounting for the misplaced notices.