tools: add lint-py.sh
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 6 Nov 2023 19:54:36 +0000 (19:54 +0000)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 9 Nov 2023 21:22:23 +0000 (16:22 -0500)
Add lint-py.sh, running the various static analysis tools we use for
Python.

Change-Id: I6ccd5f7fb484506a0f936d7fe276042cccd186a6
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11269
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Makefile.am
tools/lint-py.sh [new file with mode: 0755]

index b3a5f29c8c46060f723c18a13e54a6417df57241..a87995b6ba2313bab38830c318c8263e079e7f27 100644 (file)
@@ -27,4 +27,5 @@ EXTRA_DIST = \
        LICENSES/MIT \
        std-ext-lib.txt \
        tools/format-cpp.sh \
+       tools/lint-py.sh \
        version
diff --git a/tools/lint-py.sh b/tools/lint-py.sh
new file mode 100755 (executable)
index 0000000..8881396
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/bash
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2023 EfficiOS, Inc.
+
+exit_code=0
+
+set -x
+
+black --diff --check . || exit_code=1
+flake8 || exit_code=1
+isort . --diff --check || exit_code=1
+
+exit $exit_code
This page took 0.025196 seconds and 4 git commands to generate.