From a685368ae9b7753586a7a2b1ffa9994281677a30 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Mon, 30 Jan 2023 21:34:24 +0100 Subject: [PATCH] Run isort import sorter during package build Signed-off-by: Benjamin Drung --- debian/control | 1 + pyproject.toml | 4 ++++ run-linters | 3 +++ 3 files changed, 8 insertions(+) diff --git a/debian/control b/debian/control index 9760928..ecf96c3 100644 --- a/debian/control +++ b/debian/control @@ -15,6 +15,7 @@ Build-Depends: dh-python, distro-info (>= 0.2~), flake8, + isort , lsb-release, python3-all, python3-apt, diff --git a/pyproject.toml b/pyproject.toml index 57a5583..f947450 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,6 @@ [tool.black] line-length = 99 + +[tool.isort] +line_length = 99 +profile = "black" diff --git a/run-linters b/run-linters index 51c7ea8..47fd1af 100755 --- a/run-linters +++ b/run-linters @@ -9,5 +9,8 @@ PYTHON_SCRIPTS=$(grep -l -r '^#! */usr/bin/python3$' .) echo "Running black..." black --check --diff . $PYTHON_SCRIPTS +echo "Running isort..." +isort --check-only --diff . + echo "Running flake8..." flake8 --max-line-length=99 --ignore=E203,W503 . $PYTHON_SCRIPTS