Browse Source

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 <clark.boylan@gmail.com>
tags/2014.2.b1
Andreas Jaeger 5 years ago
parent
commit
4839414237
2 changed files with 8 additions and 0 deletions
  1. 1
    0
      doc/source/setup.rst
  2. 7
    0
      tox.ini

+ 1
- 0
doc/source/setup.rst View File

@@ -42,6 +42,7 @@ And that you have the following tools available on your system:
42 42
 - git_
43 43
 - setuptools_
44 44
 - pip_
45
+- msgfmt (part of the gettext package)
45 46
 
46 47
 **Reminder**: If you're successfully using a different platform, or a
47 48
 different version of the above, please document your configuration here!

+ 7
- 0
tox.ini View File

@@ -10,11 +10,18 @@ setenv = VIRTUAL_ENV={envdir}
10 10
 deps = -r{toxinidir}/requirements.txt
11 11
        -r{toxinidir}/test-requirements.txt
12 12
 commands = python setup.py testr --slowest --testr-args='{posargs}'
13
+whitelist_externals = bash
13 14
 
14 15
 [testenv:pep8]
15 16
 envdir = {toxworkdir}/venv
16 17
 commands = 
17 18
   flake8 {posargs}
19
+  # Check that .po and .pot files are valid.
20
+  # NOTE(jaegerandi): We search for files ending with '.po' or '.pot'.
21
+  # The regex '.*\.pot?' does not work on OS X and we assume there are no
22
+  # files with more than one "t" that have to be ignored.
23
+  bash -c "find keystone -type f -regex '.*\.pot*' -print0| \
24
+           xargs -0 -n 1 msgfmt --check-format -o /dev/null"
18 25
 
19 26
 [tox:jenkins]
20 27
 downloadcache = ~/cache/pip

Loading…
Cancel
Save