You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Java properties file, the flag "auto-java-messageformat" is automatically added to all strings.
The documentation states to use "ignore-java-format" to ignore this check.
But here's the implementation of the JavaMessageFormatCheck should_skip method:
def should_skip(self, unit):
if "auto-java-messageformat" in unit.all_flags and "{0" in unit.source:
return False
return super().should_skip(unit)
The check for the auto flag is always checked before the "ignore-java-format" check that is done in the super. Making it impossible to disable this check when the file type is properly defined.
I believe this makes the documentation wrong, and the ignore flag useless.
Being able to ignore this check is important, for example, in my use case, we have custom code that automatically doubles single quotes, so we don't need the check and we can replace it with a placeholders flag instead.
I believe the correct implementation might be something like:
def should_skip(self, unit):
return super().should_skip(unit) or not ("auto-java-messageformat" in unit.all_flags and "{0" in unit.source)
Describe the issue
When using Java properties file, the flag "auto-java-messageformat" is automatically added to all strings.
The documentation states to use "ignore-java-format" to ignore this check.
But here's the implementation of the JavaMessageFormatCheck should_skip method:
The check for the auto flag is always checked before the "ignore-java-format" check that is done in the super. Making it impossible to disable this check when the file type is properly defined.
I believe this makes the documentation wrong, and the ignore flag useless.
Being able to ignore this check is important, for example, in my use case, we have custom code that automatically doubles single quotes, so we don't need the check and we can replace it with a placeholders flag instead.
I believe the correct implementation might be something like:
I already tried
Steps to reproduce the behavior
For another repor:
Same steps but replace ignore-java-format by ignore-all-checks
Expected behavior
There is no failed check since the check should be ignored by flags
Screenshots
No response
Exception traceback
No response
How do you run Weblate?
weblate.org service
Weblate versions
Weblate 4.18-dev on hosted.weblate.org
Weblate deploy checks
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: