check for textdomain paths without '/translations', and binary paths referring to 'external' data

The convention that [textdomain] uses "/translations" is strongly established, and I can't think of a legitimate reason for an add-on not to be following it.

The binary path check is a crude test. The names that took hold for menu image directories are "/public" and variations of "/external*", so we look for those strings. It does not catch the worst case of all - when all binaries are outside the campaign define, not just a set-aside directory.

I first thought of these checks while brainstorming ways to use the in_textdomain and in_binary_path code in hack_syntax(). However, realizing that these checks did not really hack any syntax, I wanted to find someplace in the sanity checks where the code would fit. I finally found it.
This commit is contained in:
Groggy Dice 2013-08-21 04:39:44 -04:00
parent 99df0ed831
commit d3bb951548

View file

@ -930,6 +930,12 @@ def local_sanity_check(filename, nav, key, prefix, value, comment):
# Bad [recruit] attribute
if parent in ("[allow_recruit]", "[disallow_recruit]") and key == "recruit":
print errlead + "recruit= should be type="
# Check [binary_path] and [textdomain] paths
if parent == '[textdomain]' and key == 'path' and not '/translations' in value:
print errlead + 'no reference to "/translations" directory in textdomain path'
if parent == '[binary_path]' and key == 'path':
if '/external' in value or '/public' in value:
print errlead + '"/external" or "/public" image directories should no longer be used'
# Accumulate data to check for missing next scenarios
if parent == '[campaign]':
if key == "first_scenario" and value != "null":