diff scripts/generate-ini.py @ 8368:e5ccabbc3cd7 stable

release: merge default to stable for 0.6.0
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Sat, 02 May 2020 21:20:43 +0200
parents ef9fd1434270
children 6eb1f66ac23f
line wrap: on
line diff
--- a/scripts/generate-ini.py	Thu Apr 09 18:03:56 2020 +0200
+++ b/scripts/generate-ini.py	Sat May 02 21:20:43 2020 +0200
@@ -1,10 +1,8 @@
-#!/usr/bin/env python2
+#!/usr/bin/env python3
 """
 Based on kallithea/lib/paster_commands/template.ini.mako, generate development.ini
 """
 
-from __future__ import print_function
-
 import re
 
 from kallithea.lib import inifile
@@ -62,6 +60,13 @@
         print('writing:', makofile)
         open(makofile, 'w').write(mako_marked_up)
 
+    lines = re.findall(r'\n(# [^ ].*)', mako_marked_up)
+    if lines:
+        print('ERROR: the template .ini file convention is to use "## Foo Bar" for text comments and "#foo = bar" for disabled settings')
+        for line in lines:
+            print(line)
+        raise SystemExit(1)
+
     # create ini files
     for fn, settings in ini_files:
         print('updating:', fn)