-
-
Notifications
You must be signed in to change notification settings - Fork 959
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
Implement checks for Object Pascal format() strings #5813
Comments
You can take look at #5248, it added Lua format. The named regex groups are AFAIK not used for anything, and I'm not convinced that they follow some consistent naming. |
A little status report plus a call for help: I've made some progress on the issue. So far I managed to get dev-docker up and running (partly, see below) on lubuntu on an old laptop of mine. I could make the desired changes add tests and run them locally in docker. So far so good. My final test would be to create a translation project in dev-docker which contains When I just the output of
the output of
Any hint what I can check or have to change? Admittedly my fork is a few hundred commits behind, so maybe I failed to pick up one or the other fix. |
Any uwsgi related log entries? |
Yes, tons of ones like the middle line of the log output above. "... GET .../socket failed permission denied ..." Plus these, which scrolled off screen before:
|
Can you try whether adding this to the dev container will help? diff --git dev-docker/weblate-dev/Dockerfile dev-docker/weblate-dev/Dockerfile
index e83036a3ec..f631cf7675 100644
--- dev-docker/weblate-dev/Dockerfile
+++ dev-docker/weblate-dev/Dockerfile
@@ -50,3 +50,4 @@ COPY requirements.txt /tmp/
RUN pip3 install -r /tmp/requirements.txt
# List should match weblate/weblate
RUN chmod -R 777 /etc/nginx/sites-available/ /var/log/nginx/ /var/lib/nginx /app/data /app/cache /run /home/weblate /etc/localtime /etc/supervisor/conf.d
+USER 1000 |
Unfortunately not. My user is in the docker group, so it should not need to run docker commands as sudo. But when I call rundev.sh without sudo, it does't even get past the "starting" phase. Without sudo the log shows:
in an endless loop |
Progress made :) After merging with main, most problems running dev-docker went away. So I was missing some fixes before. My tests were successful so the PR is about to come in a few minutes. |
Fixed version and moved #5813 to correct section.
Thank you for your report; the issue you have reported has just been fixed.
|
I'd like to add checks for Object Pascal format() strings.
c-format
is pretty close, but doesn't catch all cases, especially not the indexed parameters. See Gnu Gettext, which links to the Free Pascal docs.Currently I'm trying to figure out, at which places functions for a new
object-pascal-format
flag have to be added.Looking through weblate's code, I found
format.py
, which definitely looks like a place to start.test_format_checks.py
too. Any other not so obvious places?One question: are there any rules for the named regex capturing groups in format.py? I see that most regexes use a similar naming scheme, but it's not consistent across all regexes. Can I conclude that there is no rule for the group names?
The text was updated successfully, but these errors were encountered: