Run black code formatter during package build

Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
This commit is contained in:
Benjamin Drung 2023-01-30 19:48:49 +01:00
parent 3354b526b5
commit db0e091e44
4 changed files with 7 additions and 0 deletions

1
debian/control vendored
View File

@ -7,6 +7,7 @@ Uploaders:
Stefano Rivera <stefanor@debian.org>,
Mattia Rizzolo <mattia@debian.org>,
Build-Depends:
black <!nocheck>,
dctrl-tools,
debhelper-compat (= 13),
devscripts (>= 2.11.0~),

1
debian/copyright vendored
View File

@ -83,6 +83,7 @@ Files: doc/bitesize.1
GPL-3
grab-merge
merge-changelog
pyproject.toml
run-linters
setup-packaging-environment
syncpackage

2
pyproject.toml Normal file
View File

@ -0,0 +1,2 @@
[tool.black]
line-length = 99

View File

@ -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