GHA CI: enforce sorted import in Python scripts

This main point is to normalize the sorting of imports in Python scripts.
Currently the default setting from isort is used: https://pycqa.github.io/isort/docs/configuration/custom_sections_and_ordering.html

PR #22793.
This commit is contained in:
Chocobo1
2025-05-31 18:01:02 +08:00
committed by GitHub
parent 96f0eebc4e
commit 50d60b9589
4 changed files with 18 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ jobs:
python-version: '3' # use default version
- name: Install tools (auxiliary scripts)
run: pip install bandit pycodestyle pyflakes
run: pip install bandit isort pycodestyle pyflakes
- name: Gather files (auxiliary scripts)
run: |
@@ -44,6 +44,10 @@ jobs:
--max-line-length=1000 \
--statistics \
$PY_FILES
isort \
--check \
--diff \
$PY_FILES
- name: Build code (auxiliary scripts)
run: |
@@ -55,7 +59,7 @@ jobs:
python-version: '3.9'
- name: Install tools (search engine)
run: pip install bandit mypy pycodestyle pyflakes pyright
run: pip install bandit isort mypy pycodestyle pyflakes pyright
- name: Gather files (search engine)
run: |
@@ -85,6 +89,10 @@ jobs:
--max-line-length=1000 \
--statistics \
$PY_FILES
isort \
--check \
--diff \
$PY_FILES
- name: Build code (search engine)
run: |