From 50b80cf0010fe207af0de1561d52fa0cad11bdef Mon Sep 17 00:00:00 2001 From: Elliot <3186037+elliot-100@users.noreply.github.com> Date: Thu, 23 May 2024 11:25:21 +0100 Subject: [PATCH] ci: isort: only target `spond` and `tests` dirs, as cannot get reliable behaviour which matches equivalent local command in root directory --- .github/workflows/python-package.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 4d59654..5261f62 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -32,12 +32,18 @@ jobs: - name: Install project run: poetry install - name: Lint imports with isort - # Use command line due to bugs/doc gaps with official `isort/isort-action`. + # Use command line due to bugs/docs gaps with official `isort/isort-action`. # Exit with error if the code is not properly formatted; show diffs; - # `black` compatibility + # `black` compatibility. + # Only target files in `spond` and `test` due to unreliable behaviour on files in + # root directory. + # Diffs reported for these files should be the same as fixes made by running + # `isort .` in the root project folder, which picks up config from + # `pyproject.toml`. run: | source $VENV - isort . --check-only --diff --profile black + isort spond --check-only --diff --profile black + isort tests --check-only --diff --profile black - name: Lint with black # by default: exit with error if the code is not properly formatted; show diffs uses: psf/black@stable