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.
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.
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.
- 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.
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.