mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Re-enable link linter (#153280)
And make URL linter always succeed for now. I'll monitor the logs manually and experiment with it futher. Pull Request resolved: https://github.com/pytorch/pytorch/pull/153280 Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
6f34d141ab
commit
3c0b93afc5
@ -61,7 +61,7 @@ while IFS=: read -r filepath url; do
|
||||
while [ "$(running_jobs)" -ge "$max_jobs" ]; do
|
||||
sleep 1
|
||||
done
|
||||
done < <(
|
||||
done < <(
|
||||
pattern='(?!.*@lint-ignore)(?<!git\+)(?<!\$\{)https?://(?![^/]*@)(?![^\s<>\")]*[<>\{\}\$])[^[:space:]<>")\[\]\\|]+'
|
||||
excludes=(
|
||||
':(exclude,glob)**/.*'
|
||||
@ -73,12 +73,17 @@ while IFS=: read -r filepath url; do
|
||||
':(exclude,glob)**/third-party/**'
|
||||
':(exclude,glob)**/third_party/**'
|
||||
)
|
||||
if [ $# -gt 0 ]; then
|
||||
paths=("$@")
|
||||
if [ $# -eq 2 ]; then
|
||||
for filename in $(git diff --name-only --unified=0 "$1...$2"); do
|
||||
git diff --unified=0 "$1...$2" -- "$filename" "${excludes[@]}" \
|
||||
| grep -E '^\+' \
|
||||
| grep -Ev '^\+\+\+' \
|
||||
| perl -nle 'print for m#'"$pattern"'#g' \
|
||||
| sed 's|^|'"$filename"':|'
|
||||
done
|
||||
else
|
||||
paths=('*')
|
||||
fi
|
||||
git --no-pager grep --no-color -I -P -o "$pattern" -- "${paths[@]}" "${excludes[@]}" \
|
||||
git --no-pager grep --no-color -I -P -o "$pattern" -- . "${excludes[@]}"
|
||||
fi \
|
||||
| sed -E 's/[^/[:alnum:]]+$//' \
|
||||
| grep -Ev '://(0\.0\.0\.0|127\.0\.0\.1|localhost)([:/])' \
|
||||
| grep -Ev '://[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' \
|
||||
|
@ -29,12 +29,17 @@ done < <(
|
||||
':(exclude,glob)**/third-party/**'
|
||||
':(exclude,glob)**/third_party/**'
|
||||
)
|
||||
if [ $# -gt 0 ]; then
|
||||
paths=("$@")
|
||||
if [ $# -eq 2 ]; then
|
||||
for filename in $(git diff --name-only --unified=0 "$1...$2"); do
|
||||
git diff --unified=0 "$1...$2" -- "$filename" "${excludes[@]}" \
|
||||
| grep -E '^\+' \
|
||||
| grep -Ev '^\+\+\+' \
|
||||
| perl -nle 'print for m#'"$pattern"'#g' \
|
||||
| sed 's|^|'"$filename"':|'
|
||||
done
|
||||
else
|
||||
paths=('*')
|
||||
fi
|
||||
git --no-pager grep --no-color -I -P -o "$pattern" -- "${paths[@]}" "${excludes[@]}" \
|
||||
git --no-pager grep --no-color -I -P -o "$pattern" -- . "${excludes[@]}"
|
||||
fi \
|
||||
| grep -Ev 'https?://' \
|
||||
| sed -E \
|
||||
-e 's#([^:]+):\[[^]]+\]\(([^)]+)\)#\1:\2#' \
|
||||
|
Reference in New Issue
Block a user