From 2eed9f51c67a9e5d29ffd4ffeee50710489aad23 Mon Sep 17 00:00:00 2001 From: Andrew Cooper Date: Mon, 8 Jan 2024 14:35:39 +0000 Subject: [PATCH] CI: Use reorder-python-imports Signed-off-by: Andrew Cooper --- .pre-commit-config.yaml | 5 +++++ build/mkcfg.py | 5 ++--- build/mkinfo.py | 4 ++-- xtf-runner | 9 ++++----- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 81a7121..2f1c3ce 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,6 +28,11 @@ repos: args: ['--fix=lf'] - id: trailing-whitespace +- repo: https://github.com/asottile/reorder-python-imports + rev: v3.12.0 + hooks: + - id: reorder-python-imports + - repo: local hooks: - id: git-diff # https://github.com/pre-commit/pre-commit/issues/1712 diff --git a/build/mkcfg.py b/build/mkcfg.py index 7f8e3d5..c1a2e19 100755 --- a/build/mkcfg.py +++ b/build/mkcfg.py @@ -1,12 +1,11 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - """ Construct an xl configuration file for a test (from various fragments), and substitue variables appropriately. """ - -import sys, os +import os +import sys # Usage: mkcfg.py $OUT $DEFAULT-CFG $EXTRA-CFG $VARY-CFG _, out, defcfg, vcpus, extracfg, varycfg = sys.argv diff --git a/build/mkinfo.py b/build/mkinfo.py index 50819e2..1c9c1ad 100755 --- a/build/mkinfo.py +++ b/build/mkinfo.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - -import sys, json +import json +import sys # Usage: mkcfg.py $OUT $NAME $CATEGORY $ENVS $VARIATIONS _, out, name, cat, envs, variations = sys.argv diff --git a/xtf-runner b/xtf-runner index 772e688..138f3b1 100755 --- a/xtf-runner +++ b/xtf-runner @@ -1,18 +1,17 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- - """ xtf-runner - A utility for enumerating and running XTF tests. Currently assumes the presence and availability of the `xl` toolstack. """ - -from __future__ import print_function, unicode_literals +from __future__ import print_function +from __future__ import unicode_literals import json -import sys, os +import os import subprocess - +import sys from functools import partial from optparse import OptionParser from os import path -- 2.39.5