You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ! lintrunner --force-color --all-files --tee-json=lint.json 2> /dev/null; then
53
+
if ! lintrunner --force-color --all-files --take MYPY --tee-json=lint.json 2> /dev/null; then
54
+
echo ""
55
+
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner --take MYPY\`. (If you don't get the same results, run \'lintrunner init\' to update your local linter)\e[0m"
56
+
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
57
+
RC=1
58
+
fi
59
+
60
+
# Use jq to massage the JSON lint output into GitHub Actions workflow commands.
# The generic Linux job chooses to use base env, not the one setup by the image
81
+
CONDA_ENV=$(conda env list --json | jq -r ".envs | .[-1]")
82
+
conda activate "${CONDA_ENV}"
83
+
84
+
CACHE_DIRECTORY="/tmp/.lintbin"
85
+
# Try to recover the cached binaries
86
+
if [[ -d "${CACHE_DIRECTORY}" ]]; then
87
+
# It's ok to fail this as lintrunner init would download these binaries
88
+
# again if they do not exist
89
+
cp -r "${CACHE_DIRECTORY}" . || true
90
+
fi
91
+
92
+
# This has already been cached in the docker image
93
+
lintrunner init
94
+
95
+
RC=0
96
+
# Run lintrunner on all files
97
+
if ! lintrunner --force-color --all-files --skip MYPY --tee-json=lint.json 2> /dev/null; then
54
98
echo ""
55
-
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner\`. (If you don't get the same results, run \'lintrunner init\' to update your local linter)\e[0m"
99
+
echo -e "\e[1m\e[36mYou can reproduce these results locally by using \`lintrunner --skip MYPY\`. (If you don't get the same results, run \'lintrunner init\' to update your local linter)\e[0m"
56
100
echo -e "\e[1m\e[36mSee https://github.com/pytorch/pytorch/wiki/lintrunner for setup instructions.\e[0m"
0 commit comments