Skip to content

Commit 6522345

Browse files
fix(common-lint): add problem matcher for nbqa flake8
1 parent faf530d commit 6522345

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/__call-common-lint.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,12 +356,25 @@ jobs:
356356
357357
- name: Python - nbqa flake8
358358
if: always()
359-
# TODO: add problem matcher: https://github.com/gustavgransbo/flake8-github-annotations/issues/11
360359
run: |
360+
echo "::group::problem matcher"
361+
set +e
362+
error=0
361363
python -m nbqa flake8 \
362-
--color=always \
364+
--format=github \
363365
--verbose \
364366
.
367+
error=$?
368+
set -e
369+
echo "::endgroup::"
370+
371+
# run nbqa flake8 again with human friendly output if there were errors
372+
if [ $error -ne 0 ]; then
373+
python -m nbqa flake8 \
374+
--color=always \
375+
--verbose \
376+
.
377+
fi
365378
366379
- name: Python - nb-clean
367380
if: always()

0 commit comments

Comments
 (0)