diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5e1ea7a99a..389da67218 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -74,11 +74,12 @@ stages: - date '+%Y%m%d-%H%M%S'; test "$NM_BUILD_TARBALL" != 1 || mv /tmp/NetworkManager-1*.tar.xz /tmp/NetworkManager-1*.src.rpm ./ checkpatch: - image: fedora:29 + image: fedora:32 stage: test script: - - date '+%Y%m%d-%H%M%S'; dnf install -y git + - date '+%Y%m%d-%H%M%S'; dnf install -y git black - date '+%Y%m%d-%H%M%S'; NM_CHECKPATCH_FETCH_UPSTREAM=1 contrib/scripts/checkpatch-feature-branch.sh 2>&1 | tee checkpatch-out.txt + - date '+%Y%m%d-%H%M%S'; black --check . allow_failure: true artifacts: when: on_failure diff --git a/Makefile.am b/Makefile.am index 285e07778f..db9f4c80c6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5236,6 +5236,12 @@ CLEANFILES += \ include Makefile.examples +if WITH_PYTHON_BLACK +check-python-black: + test "$$NMTST_SKIP_PYTHON_BLACK" != 1 && $(BLACK) --check $(top_srcdir) +check_local += check-python-black +endif + ############################################################################### check-local: $(check_local) diff --git a/configure.ac b/configure.ac index 175ee554ed..2ace7ecaee 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 \