Skip to content

Commit 6a44e06

Browse files
suopytorchmergebot
authored andcommitted
[lint] preoperly suggest lintrunner when lint fails
We had `set -e` implicitly set by GitHub Actions, so the script was aborting before we had a change to echo our help message. Fix that. Pull Request resolved: pytorch#76852 Approved by: https://github.com/ezyang
1 parent da15d76 commit 6a44e06

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/lint.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ jobs:
4848
env:
4949
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
5050
run: |
51-
lintrunner -vv --force-color --merge-base-with "${PR_BASE_SHA}"
52-
echo ""
53-
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner\`.\e[0m"
54-
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
51+
set +e
52+
if ! lintrunner -vv --force-color --merge-base-with "${PR_BASE_SHA}" ; then
53+
echo ""
54+
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner\`.\e[0m"
55+
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
56+
exit 1
57+
fi
5558
5659
- name: Store annotations
5760
if: always() && github.event_name == 'pull_request'

0 commit comments

Comments
 (0)