New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dennis shows a warning rather than an error for a missing leading % in a placholder #101
Comments
Can you copy/paste the complete output? That makes it easier to build a test case and look into. |
|
Ahh.. ok. Dennis was originally written to detect translated strings that when interpolated would throw an error and cause the application to return an HTTP 500. This was deemed an "error". Anything that was possibly bad, but wouldn't result in an HTTP 500 was considered a "warning". Part of the reason for that is that the warning linting rules tend to be more hand-wavey and there's more of a chance of false positives. You probably know this since you seem to be running in errors-only mode. Anyhow, an "error" doesn't indicate that the translation is bad except the case when it's bad such that it causes an HTTP 500. In this case, the translated string won't cause a Python exception, so it shouldn't be an error. Further, it's possible for the translated string to not want to include all the variables from the original string. I've seen that happen before. Given that, we shouldn't change it to be an error. If it's the case that in AMO you can say with certainty that all variables in the original string should also show up in the translated string, then you could write a plugin that has this AMO-specific rule. However, Dennis doesn't quite support plugins, yet, so that'd need to be implemented first. That's covered in #9. |
Relatedly, the two projects I worked on that was the impetus for writing Dennis are both dead now (SUMO and Input), so I haven't been spending much if any time on Dennis and no one else works on Dennis. If Dennis is important to AMO (and this is true of any other project that uses Dennis), then someone should be spending some time to help out. If not, then maybe AMO should look for a different tool to use or roll their own. |
If you have a string like
(foo)s blah %(bar)s
dennis returnsW202 Missing variables in translated string
. I would have expected this to be an error since it results in untranslated content.This is obvious but since it's a warning it's not seen when running in errors-only mode.
The text was updated successfully, but these errors were encountered: