Skip to content

Traps the unreasonable error code 3 from docformatter #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions og/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ runs:
shell: bash

- run: |
MODIFIED_PY_FILES="$(git diff origin/${{ inputs.base_branch }} --diff-filter=MAC --name-only | grep -i '\.py$' | sed -z 's/\n/ /g')"
MODIFIED_PY_FILES="$(git diff origin/${{ inputs.base_branch }} --diff-filter=MAC --name-only | grep -i '\.py$' | xargs -r realpath)"
if [ -n "${MODIFIED_PY_FILES}" ]; then \
echo "Running black..." ; \
black ${MODIFIED_PY_FILES} ; \
echo "Running isort..." ; \
isort --profile=black ${MODIFIED_PY_FILES} ; \
docformatter --recursive --in-place --wrap-summaries 88 --wrap-descriptions 88 ${MODIFIED_PY_FILES} ; \
echo "Running docformatter..." ; \
trap 'docformatter --recursive --in-place --wrap-summaries 88 --wrap-descriptions 88 ${MODIFIED_PY_FILES} || echo "docformatter returned status 3."' EXIT; \
echo "Running flake8..." ; \
flake8 --ignore=E203,E501,W503 ${MODIFIED_PY_FILES} ; \
fi
shell: bash