Skip to content

Commit e0a0839

Browse files
authored
Traps the unreasonable error code 3 from docformatter (#39)
* fix * debug * trap
1 parent 282e7c0 commit e0a0839

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

og/lint/action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ runs:
1515
shell: bash
1616
1717
- run: |
18-
MODIFIED_PY_FILES="$(git diff origin/${{ inputs.base_branch }} --diff-filter=MAC --name-only | grep -i '\.py$' | sed -z 's/\n/ /g')"
18+
MODIFIED_PY_FILES="$(git diff origin/${{ inputs.base_branch }} --diff-filter=MAC --name-only | grep -i '\.py$' | xargs -r realpath)"
1919
if [ -n "${MODIFIED_PY_FILES}" ]; then \
20+
echo "Running black..." ; \
2021
black ${MODIFIED_PY_FILES} ; \
22+
echo "Running isort..." ; \
2123
isort --profile=black ${MODIFIED_PY_FILES} ; \
22-
docformatter --recursive --in-place --wrap-summaries 88 --wrap-descriptions 88 ${MODIFIED_PY_FILES} ; \
24+
echo "Running docformatter..." ; \
25+
trap 'docformatter --recursive --in-place --wrap-summaries 88 --wrap-descriptions 88 ${MODIFIED_PY_FILES} || echo "docformatter returned status 3."' EXIT; \
26+
echo "Running flake8..." ; \
2327
flake8 --ignore=E203,E501,W503 ${MODIFIED_PY_FILES} ; \
2428
fi
2529
shell: bash

0 commit comments

Comments
 (0)