chiark / gitweb /
lint: check all build fields against accepted list
authorMichael Pöhn <michael.poehn@fsfe.org>
Tue, 27 Jun 2017 20:46:19 +0000 (22:46 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 6 Jul 2017 10:25:48 +0000 (12:25 +0200)
This makes sure there are no typoed or wrong build fields in all metadata
files.

fdroidserver/lint.py

index 200bddf6f501f9b9167f657216263f6784acc36d..04ef0f9cbbdb202cddfe2bcfaff1472b48256e75 100644 (file)
@@ -299,6 +299,8 @@ def check_bulleted_lists(app):
 
 
 def check_builds(app):
+    supported_flags = set(metadata.build_flags)
+    # needed for YAML and JSON
     for build in app.builds:
         if build.disable:
             if build.disable.startswith('Generated by import.py'):
@@ -311,6 +313,9 @@ def check_builds(app):
                 ref = srclib.split('@')[1].split('/')[0]
                 if ref.startswith(s):
                     yield "Branch '%s' used as commit in srclib '%s'" % (s, srclib)
+        for key in build.keys():
+            if key not in supported_flags:
+                yield key + ' is not an accepted build field'
 
 
 def check_files_dir(app):