From 48394142371702715e7204f4ffb7fd32a2b50a6b Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 31 Mar 2014 20:54:06 +0200 Subject: [PATCH] Check that all po/pot files are valid Perform minimal checks on po and pot files so that no broken files can get imported. Add msgfmt to list of requirements in doc/source/setup.rst. Change-Id: Ifa9fe2fc1ca9a41621ff3039c249700cdb1cd0ac Related-Bug: #1299349 Co-Authored-By: Clark Boylan --- doc/source/setup.rst | 1 + tox.ini | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/doc/source/setup.rst b/doc/source/setup.rst index d07e9a913..ba53b2eea 100644 --- a/doc/source/setup.rst +++ b/doc/source/setup.rst @@ -42,6 +42,7 @@ And that you have the following tools available on your system: - git_ - setuptools_ - pip_ +- msgfmt (part of the gettext package) **Reminder**: If you're successfully using a different platform, or a different version of the above, please document your configuration here! diff --git a/tox.ini b/tox.ini index d800b6817..02c35768e 100644 --- a/tox.ini +++ b/tox.ini @@ -10,11 +10,18 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' +whitelist_externals = bash [testenv:pep8] envdir = {toxworkdir}/venv commands = flake8 {posargs} + # Check that .po and .pot files are valid. + # NOTE(jaegerandi): We search for files ending with '.po' or '.pot'. + # The regex '.*\.pot?' does not work on OS X and we assume there are no + # files with more than one "t" that have to be ignored. + bash -c "find keystone -type f -regex '.*\.pot*' -print0| \ + xargs -0 -n 1 msgfmt --check-format -o /dev/null" [tox:jenkins] downloadcache = ~/cache/pip