[libvirt] [PATCH 2/2] Add syntax-check to make sure Python files don't contain trailing semicolon

We allow for a trailing semicolon in full line comments since docs/index.py has some SQL statements in it. --- cfg.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cfg.mk b/cfg.mk index 2dfde01..b92ae85 100644 --- 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 -- 1.7.10.4

On Thu, Feb 07, 2013 at 09:23:01AM +0100, Guido Günther wrote:
We allow for a trailing semicolon in full line comments since docs/index.py has some SQL statements in it. --- cfg.mk | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/cfg.mk b/cfg.mk index 2dfde01..b92ae85 100644 --- 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
ACK, I was just going to suggest this as feedback to your previous patch ! Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Thu, Feb 07, 2013 at 12:39:07PM +0000, Daniel P. Berrange wrote:
On Thu, Feb 07, 2013 at 09:23:01AM +0100, Guido Günther wrote:
We allow for a trailing semicolon in full line comments since docs/index.py has some SQL statements in it. --- cfg.mk | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/cfg.mk b/cfg.mk index 2dfde01..b92ae85 100644 --- 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
ACK, I was just going to suggest this as feedback to your previous patch ! Both pushed. Thanks, -- Guido
participants (2)
-
Daniel P. Berrange
-
Guido Günther