]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
ci: add isort 670/head
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 2 Mar 2021 17:27:44 +0000 (18:27 +0100)
committerJoerg Behrmann <behrmann@physik.fu-berlin.de>
Tue, 2 Mar 2021 18:12:31 +0000 (19:12 +0100)
.github/workflows/ci-unit-test.yml
mkosi/__init__.py
mkosi/__main__.py
pyproject.toml

index 683d85fb183103633a33b0fe341e50afd3f270f9..b3a82bac6cc819f2958f086d33aa833b9b7f67ad 100644 (file)
@@ -15,11 +15,14 @@ jobs:
     - uses: actions/checkout@v2
 
     - name: Install
-      run: python3 -m pip install pytest mypy black
+      run: python3 -m pip install pytest mypy black isort
 
     - name: Check formatting
       run: python3 -m black --check mkosi/ tests/
 
+    - name: Check that imports are sorted
+      run: python3 -m isort --verbose --check-only mkosi/
+
     - name: Type Checking
       run: python3 -m mypy mkosi
 
index 0a283f5c094331c3da848217ec744f6143b74c37..b1cee144458024d6e578dceafb52dfd007abe6f6 100644 (file)
@@ -36,11 +36,14 @@ import urllib.request
 import uuid
 from subprocess import DEVNULL, PIPE
 from textwrap import dedent
+from types import FrameType
 from typing import (
     IO,
+    TYPE_CHECKING,
     Any,
     BinaryIO,
     Callable,
+    ContextManager,
     Dict,
     Generator,
     Iterable,
@@ -54,14 +57,10 @@ from typing import (
     Tuple,
     Union,
     cast,
-    TYPE_CHECKING,
-    ContextManager,
 )
-from types import FrameType
 
 from .printer import MkosiPrinter
 
-
 __version__ = "9"
 
 
index f794cd3737e8f04f4782a05c120e52362df0231d..e70e22ffe41117b602f12d38ac8e091df496c317 100644 (file)
@@ -3,7 +3,7 @@
 import os
 import sys
 
-from . import parse_args, complete_step, run_verb, die, MkosiException
+from . import MkosiException, complete_step, die, parse_args, run_verb
 
 
 def main() -> None:
index c5af75a600dfbf306168f85d647d934bee422d68..31f8e56a83bb75e607b1c8b09205f8c64e105725 100644 (file)
@@ -1,3 +1,8 @@
 [tool.black]
 line-length = 119
 target-version = ['py37']
+
+[tool.isort]
+profile = "black"
+multi_line_output = 3
+py_version = "37"