Commit Graph

10 Commits

Author SHA1 Message Date
OMGeeky
11d5966a51 Sort summary output of errors and warnings by file path 2025-07-28 22:00:24 +02:00
OMGeeky
fd169e9f40 Add total error and warning summary to format specifier check output 2025-07-28 21:59:19 +02:00
OMGeeky
149ad3ae1c Differentiate between missing and extra format specifiers
Missing format specifiers in translated strings are now reported as warnings,
while extra format specifiers are reported as errors.
This change allows the script to pass if only warnings (missing specifiers)
are present, but still fail if there are errors (extra specifiers).

The summary now also includes counts for both errors and warnings per file.
2025-07-28 21:57:29 +02:00
OMGeeky
6e74243ea8 Refactor: Improve format specifier regex
The regular expression for identifying format specifiers in XML string resources has been updated. The new regex now correctly identifies specifiers like `%.2f` which include precision for floating point numbers. This change ensures more accurate validation of format specifiers.
2025-07-28 21:51:59 +02:00
OMGeeky
9c4009034f Enhance format specifier check script output
The script now provides a summary of errors per file at the end of its execution.
This makes it easier to identify which translation files have issues with format specifiers or non-escaped percentage signs.
2025-07-28 21:51:31 +02:00
OMGeeky
0422beb855 Update string formatter check script
- Add scanning for used keys in Java files.
- Refactor argument parsing to separate project root and res root.
- If no specific key is provided, check only keys used in Java code.
2025-07-28 21:35:38 +02:00
OMGeeky
2cc12b3530 Improve check_format_specifiers.py to check all keys if none specified 2025-07-28 21:25:28 +02:00
OMGeeky
80997ddc36 Exit with error code on specifier mismatches in format checker 2025-07-28 21:20:17 +02:00
OMGeeky
c244ba1390 Added checks for unescaped percent signs 2025-07-28 21:12:23 +02:00
OMGeeky
8a74ffd2ef Add Python script to check format specifier consistency in Android strings
This script, `check_format_specifiers.py`, helps ensure that format
specifiers (like `%s`, `%d`, `%1$s`) are used consistently across
different language versions of a string resource in an Android project.
2025-07-28 21:01:11 +02:00