-
Notifications
You must be signed in to change notification settings - Fork 0
docs/fix: follow-up CodeRabbit fixes from PR #404 (item-7 wording, AllUsers exit code, audit tool hardening) #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mixmansoundude
merged 2 commits into
main
from
claude/bootstrapper-execution-branches-ox2izi
Jul 31, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| from tools import audit_console_messages as acm | ||
|
|
||
|
|
||
| def test_normalize_env_var(): | ||
| assert acm.normalize('[INFO] Log: %LOG%') == '[INFO] Log: <V>' | ||
|
|
||
|
|
||
| def test_normalize_positional_param(): | ||
| assert acm.normalize('[ERROR] Workspace path invalid: %~dp0') == '[ERROR] Workspace path invalid: <V>' | ||
| assert acm.normalize('*** Using drag-and-drop file: %~1') == '*** Using drag-and-drop file: <V>' | ||
|
|
||
|
|
||
| def test_normalize_for_loop_var(): | ||
| assert acm.normalize('[WARN] Repair failed: %%M') == '[WARN] Repair failed: <V>' | ||
| assert acm.normalize('[WARN] zip too small (%%~zS bytes)') == '[WARN] zip too small (<V> bytes)' | ||
|
|
||
|
|
||
| def test_normalize_literal_percent_not_consumed_by_later_var(): | ||
| # A literal, isolated '%' earlier in the line must not be greedily paired with a | ||
| # real %VAR% later in the same line. | ||
| assert acm.normalize('10% free on %DRIVE%') == '10% free on <V>' | ||
|
|
||
|
|
||
| def test_normalize_adjacent_expansions(): | ||
| # Realistic adjacent expansions (a separator between them, as always occurs in actual | ||
| # run_setup.bat message text) each normalize independently. | ||
| assert acm.normalize('rc=%RC% size=%SIZE%') == 'rc=<V> size=<V>' | ||
|
|
||
|
|
||
| def test_extract_records_skips_echo_control_tokens(tmp_path): | ||
| bat = tmp_path / 'run_setup.bat' | ||
| bat.write_text('@echo off\necho.\necho on\necho [INFO] real message\n', encoding='ascii') | ||
| records = acm.extract_records(bat) | ||
| assert records == [(4, '[INFO] real message')] | ||
|
|
||
|
|
||
| def test_extract_records_case_insensitive_call_log(tmp_path): | ||
| bat = tmp_path / 'run_setup.bat' | ||
| bat.write_text('CALL :LOG "[INFO] upper case call"\n', encoding='ascii') | ||
| records = acm.extract_records(bat) | ||
| assert records == [(1, '[INFO] upper case call')] | ||
|
|
||
|
|
||
| def test_extract_records_skips_redirected_lines(tmp_path): | ||
| bat = tmp_path / 'run_setup.bat' | ||
| bat.write_text( | ||
| 'echo not visible >> log.txt\n' | ||
| 'call :log "not visible either" >> log.txt\n' | ||
| 'echo [INFO] visible line\n', | ||
| encoding='ascii', | ||
| ) | ||
| records = acm.extract_records(bat) | ||
| assert records == [(3, '[INFO] visible line')] | ||
|
|
||
|
|
||
| def test_is_covered_true_when_all_segments_present(): | ||
| assert acm.is_covered('[INFO] Log: <V>', '... [INFO] Log: C:\\work\\ ...') is True | ||
|
|
||
|
|
||
| def test_is_covered_false_when_missing(): | ||
| assert acm.is_covered('[WARN] never documented anywhere', 'totally unrelated corpus text') is False | ||
|
|
||
|
|
||
| def test_main_reports_error_on_missing_file(tmp_path, capsys): | ||
| missing = tmp_path / 'nope.bat' | ||
| doc = tmp_path / 'demo.md' | ||
| doc.write_text('placeholder', encoding='utf-8') | ||
| result = acm.main(['--file', str(missing), '--demo-doc', str(doc)]) | ||
| captured = capsys.readouterr() | ||
| assert result == 2 | ||
| assert 'not found' in captured.err | ||
|
|
||
|
|
||
| def test_main_reports_error_on_directory_path(tmp_path, capsys): | ||
| doc = tmp_path / 'demo.md' | ||
| doc.write_text('placeholder', encoding='utf-8') | ||
| result = acm.main(['--file', str(tmp_path), '--demo-doc', str(doc)]) | ||
| captured = capsys.readouterr() | ||
| assert result == 2 | ||
| assert 'not found' in captured.err |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.