feat(#16): raise error when fuzzy detected#17
feat(#16): raise error when fuzzy detected#17angryfoxx wants to merge 1 commit intoflashcode:mainfrom
Conversation
|
Hello @angryfoxx, Thanks for your PR! Fuzzy strings are not really "errors" in the file, as they are not used at runtime (it's like if strings were not translated). But I agree it's nice to know we have fuzzy strings in the translations. By the way you have some other easy ways to find them, for example with Or with pocount: It could be added in msgcheck as well, but this should be an optional check disabled by default (with a new command line option), as msgcheck is really focused on "errors" in translations, ie typos, punctuation, etc., not on translation progress (number of fuzzy or untranslated strings). |
|
ok i will work on this, i think this tool would be great after this implemantation thx for your review @flashcode |
|
hi @flashcode could u rw again |
There was a problem hiding this comment.
Pull request overview
This PR adds a new error_on_fuzzy option that raises an error when fuzzy strings are detected in PO files, addressing issue #16. Unlike the existing fuzzy check which processes fuzzy strings for validation, this new option treats the presence of fuzzy strings as an error condition.
Changes:
- Added
--error-on-fuzzy/-FCLI flag to report fuzzy strings as errors - Implemented fuzzy detection logic that reports each fuzzy string found
- Added comprehensive test coverage for both positive and negative cases
- Updated .gitignore with standard Python development artifacts
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/test_msgcheck.py | Added two test functions validating the error_on_fuzzy option with and without fuzzy strings present |
| src/msgcheck/po.py | Added error_on_fuzzy check option and implementation to detect and report fuzzy strings |
| src/msgcheck/msgcheck.py | Added CLI argument for error-on-fuzzy flag and integrated it into option processing |
| .gitignore | Added common Python development directories and cache files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks, I'll check this. For your information, I'm developing a new tool to replace msgcheck: https://github.com/poexam/poexam It is a completely new project (first official version pushed a few minutes ago), but it should work fine, and it's blazingly fast (written in Rust), you can try it! It can check (with more rules than msgcheck) and also give detailed statistics about .po files. |
No description provided.