From db0e091e443241edc56746c3693edb8012c2e777 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Mon, 30 Jan 2023 19:48:49 +0100 Subject: [PATCH] Run black code formatter during package build Signed-off-by: Benjamin Drung --- debian/control | 1 + debian/copyright | 1 + pyproject.toml | 2 ++ run-linters | 3 +++ 4 files changed, 7 insertions(+) create mode 100644 pyproject.toml diff --git a/debian/control b/debian/control index 68f4560..9760928 100644 --- a/debian/control +++ b/debian/control @@ -7,6 +7,7 @@ Uploaders: Stefano Rivera , Mattia Rizzolo , Build-Depends: + black , dctrl-tools, debhelper-compat (= 13), devscripts (>= 2.11.0~), diff --git a/debian/copyright b/debian/copyright index 2e0c9a8..d13345a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -83,6 +83,7 @@ Files: doc/bitesize.1 GPL-3 grab-merge merge-changelog + pyproject.toml run-linters setup-packaging-environment syncpackage diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..57a5583 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.black] +line-length = 99 diff --git a/run-linters b/run-linters index 9d7039a..51c7ea8 100755 --- a/run-linters +++ b/run-linters @@ -6,5 +6,8 @@ set -eu PYTHON_SCRIPTS=$(grep -l -r '^#! */usr/bin/python3$' .) +echo "Running black..." +black --check --diff . $PYTHON_SCRIPTS + echo "Running flake8..." flake8 --max-line-length=99 --ignore=E203,W503 . $PYTHON_SCRIPTS