From 163cd4b11889773a6790620b257a5172c56446a7 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 6 Nov 2023 19:54:36 +0000 Subject: [PATCH] tools: add lint-py.sh Add lint-py.sh, running the various static analysis tools we use for Python. Change-Id: I6ccd5f7fb484506a0f936d7fe276042cccd186a6 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/11269 Tested-by: jenkins Reviewed-by: Philippe Proulx --- Makefile.am | 1 + tools/lint-py.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 tools/lint-py.sh diff --git a/Makefile.am b/Makefile.am index b3a5f29c..a87995b6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 index 00000000..88813967 --- /dev/null +++ b/tools/lint-py.sh @@ -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 -- 2.34.1