]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
syntax-check: Ensure Python is called via env(1)
authorAndrea Bolognani <abologna@redhat.com>
Mon, 20 Feb 2023 10:12:44 +0000 (11:12 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 20 Feb 2023 17:33:16 +0000 (18:33 +0100)
The syntax-check rule that calls flake8 on Python scripts
expects this to be the case, and it's the best practice anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
build-aux/syntax-check.mk

index 96d322ee0454c0c2bcab7637845b8ba9699f57cd..21f6b311ce4c09a68dfe280cfd4a8fffddd4b0d2 100644 (file)
@@ -561,6 +561,11 @@ sc_require_enum_last_marker:
          { echo 'enum impl needs _LAST marker on second line' 1>&2; \
            exit 1; } || :
 
+sc_prohibit_python_without_env:
+       @prohibit='#!/usr/.*/py''thon' \
+        halt='always call python via /usr/bin/env' \
+          $(_sc_search_regexp)
+
 # We're intentionally ignoring a few warnings
 #
 # E501: Force breaking lines at < 80 characters results in