From 9f77d26ad0ffaa51d9b262ea4d9b28bbc58b6f68 Mon Sep 17 00:00:00 2001 From: Sayed Shah Date: Tue, 9 Jun 2020 16:22:51 -0400 Subject: [PATCH] build: create check for python black If python black is install then it would check the formating of all of the python files and test the for it. Otherwise, it would just simply ignore the python black if python black is not installed. --- Makefile.am | 5 +++++ configure.ac | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Makefile.am b/Makefile.am index 285e07778..71643080b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5235,6 +5235,11 @@ CLEANFILES += \ ############################################################################### include Makefile.examples +if WITH_PYTHON_BLACK +check-python-black: + $(BLACK) --check $(top_srcdir) +check_local += check-python-black +endif ############################################################################### diff --git a/configure.ac b/configure.ac index 175ee554e..2ace7ecae 100644 --- a/configure.ac +++ b/configure.ac @@ -1272,6 +1272,10 @@ else have_introspection=no fi +# check for python black. And check if all files are formatted with python black +AC_PATH_PROG(BLACK, black) +AM_CONDITIONAL(WITH_PYTHON_BLACK, test "${BLACK}" != "") + # check for pregenerated manpages and documentation to be installed use_pregen_docs=no if test "$build_docs" != "yes" -a \