bito-code-review[bot] commented on code in PR #40395:
URL: https://github.com/apache/superset/pull/40395#discussion_r3293408266
##########
scripts/translations/backfill_po.py:
##########
@@ -95,6 +113,14 @@
}
+def _ensure_license_header(po_path: Path) -> None:
+ """Prepend the ASF license header to the .po file if it is missing."""
+ content = po_path.read_text(encoding="utf-8")
+ if "Licensed to the Apache Software Foundation" not in content:
+ po_path.write_text(_ASF_LICENSE_HEADER + content, encoding="utf-8")
+ print(f"Added ASF license header to {po_path}", file=sys.stderr)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing test coverage for new function</b></div>
<div id="fix">
The new `_ensure_license_header` function has no test coverage in
`tests/unit_tests/scripts/translations/backfill_po_test.py`. Adding tests
ensures the function correctly prepends the license header and doesn't corrupt
files when the header is already present.
</div>
</div>
<small><i>Code Review Run #872c8b</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]