Add unit tests for scripts/rtl_ltr_linter.py #13431
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.48) × (1 − Review Confidence (0.42)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.48 · 78 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 10%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.261
No Reviewer Assigned
no_reviewer_assigned
0.120
Real PR Conversation Timeline
1 item
"Review active on #13431"
general
weight: 0.35
jmenezes-cyber
Summary
scripts/rtl_ltr_linter.py(the RTL/LTR Markdown linter run in CI) currently has no automated test coverage. This PR adds a small pytest suite for it:is_rtl_filename()— filename-based direction detectionsplit_by_span()— nested<span dir="...">context splittingload_config()— default configuration values<div dir="...">tag must not leave the block-context stack unbalanced (which would otherwise trigger a false "unclosed div" error on later lines).I verified the regression test is meaningful: reproducing the old (pre-fix) single-match-then-
continuelogic described in #12500 makes this new test fail, while it passes against the currentmaincode.Test plan
pip install python-bidi PyYAML pytestpytest scripts/test_rtl_ltr_linter.py -v— all 10 tests pass locallylint_file(), and passes against currentmain