]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Add syntax-check to make sure Python files don't contain trailing semicolon
authorGuido Günther <agx@sigxcpu.org>
Thu, 7 Feb 2013 07:01:52 +0000 (08:01 +0100)
committerGuido Günther <agx@sigxcpu.org>
Thu, 7 Feb 2013 18:52:49 +0000 (19:52 +0100)
We allow for a trailing semicolon in full line comments since
docs/index.py has some SQL statements in it.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 309a2d7f66523f6f52e1b6c8edd2e99e88c0b0cb..7a11a5d89f1d54a69c0bba5ba074046712341801 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -702,6 +702,13 @@ sc_require_enum_last_marker:
          { echo '$(ME): enum impl needs to use _LAST marker' 1>&2;     \
            exit 1; } || :
 
+# In Python files we don't want to end lines with a semicolon like in C
+sc_prohibit_semicolon_at_eol_in_python:
+       @prohibit='^[^#].*\;$$'                                         \
+       in_vc_files='\.py$$'                                            \
+       halt="Don't use semicolon at eol in python files"               \
+         $(_sc_search_regexp)
+
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null