mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-21 15:10:27 +00:00
Ignore username in todo comment in spell-check
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
],
|
],
|
||||||
"ignoreRegExpList": [
|
"ignoreRegExpList": [
|
||||||
// Copyright notice
|
// Copyright notice
|
||||||
"Copyright ((\\(c\\)|\\(C\\)|©) )?.*",
|
"Copyright .*",
|
||||||
// GHA actions/workflows
|
// GHA actions/workflows
|
||||||
"uses: .+@",
|
"uses: .+@",
|
||||||
// GHA context (repo name, owner name, etc.)
|
// GHA context (repo name, owner name, etc.)
|
||||||
@@ -35,6 +35,8 @@
|
|||||||
"( |\\[)@[\\w_-]+",
|
"( |\\[)@[\\w_-]+",
|
||||||
// Git config username
|
// Git config username
|
||||||
"git config user.name .*",
|
"git config user.name .*",
|
||||||
|
// Username in todo comment
|
||||||
|
"(TODO|FIXME)\\([\\w_., -]+\\)",
|
||||||
// Cargo.toml authors
|
// Cargo.toml authors
|
||||||
"authors *= *\\[.*\\]",
|
"authors *= *\\[.*\\]",
|
||||||
"\".* <[\\w_.+-]+@[\\w.-]+>\""
|
"\".* <[\\w_.+-]+@[\\w.-]+>\""
|
||||||
|
|||||||
5
.github/.cspell/organization-dictionary.txt
vendored
5
.github/.cspell/organization-dictionary.txt
vendored
@@ -85,6 +85,7 @@ acqrel
|
|||||||
alloc
|
alloc
|
||||||
bools
|
bools
|
||||||
builtins
|
builtins
|
||||||
|
bytecount
|
||||||
canonicalize
|
canonicalize
|
||||||
consts
|
consts
|
||||||
ctypes
|
ctypes
|
||||||
@@ -98,6 +99,7 @@ inlateout
|
|||||||
intrinsics
|
intrinsics
|
||||||
lateout
|
lateout
|
||||||
mclass
|
mclass
|
||||||
|
memcpy
|
||||||
msrv
|
msrv
|
||||||
nand
|
nand
|
||||||
nomem
|
nomem
|
||||||
@@ -110,6 +112,7 @@ rclass
|
|||||||
repr
|
repr
|
||||||
rfind
|
rfind
|
||||||
rfold
|
rfold
|
||||||
|
rposition
|
||||||
rsplit
|
rsplit
|
||||||
rustlib
|
rustlib
|
||||||
seqcst
|
seqcst
|
||||||
@@ -124,6 +127,8 @@ unsized
|
|||||||
upcastable
|
upcastable
|
||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
armel
|
||||||
|
armhf
|
||||||
binutils
|
binutils
|
||||||
connrefused
|
connrefused
|
||||||
cygwin
|
cygwin
|
||||||
|
|||||||
@@ -41,6 +41,14 @@ warn() {
|
|||||||
fi
|
fi
|
||||||
should_fail=1
|
should_fail=1
|
||||||
}
|
}
|
||||||
|
error() {
|
||||||
|
if [[ -n "${GITHUB_ACTIONS:-}" ]]; then
|
||||||
|
echo "::error::$*"
|
||||||
|
else
|
||||||
|
echo >&2 "error: $*"
|
||||||
|
fi
|
||||||
|
should_fail=1
|
||||||
|
}
|
||||||
|
|
||||||
if [[ $# -gt 0 ]]; then
|
if [[ $# -gt 0 ]]; then
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
@@ -70,6 +78,11 @@ if [[ -n "$(git ls-files '*.rs')" ]]; then
|
|||||||
else
|
else
|
||||||
warn "'rustup' is not installed"
|
warn "'rustup' is not installed"
|
||||||
fi
|
fi
|
||||||
|
cast_without_turbofish=$(grep -n -E '\.cast\(\)' $(git ls-files '*.rs') || true)
|
||||||
|
if [[ -n "${cast_without_turbofish}" ]]; then
|
||||||
|
error "please replace \`.cast()\` with \`.cast::<type_name>()\`:"
|
||||||
|
echo "${cast_without_turbofish}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# C/C++ (if exists)
|
# C/C++ (if exists)
|
||||||
@@ -103,8 +116,8 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
|
|||||||
permissions=$(yq '.permissions' "${workflow}" | jq -c)
|
permissions=$(yq '.permissions' "${workflow}" | jq -c)
|
||||||
case "${permissions}" in
|
case "${permissions}" in
|
||||||
'{"contents":"read"}' | '{"contents":"none"}' | '{}') ;;
|
'{"contents":"read"}' | '{"contents":"none"}' | '{}') ;;
|
||||||
null) warn "${workflow}: top level permissions not found; it must be 'contents: read' or weaker permissions" ;;
|
null) error "${workflow}: top level permissions not found; it must be 'contents: read' or weaker permissions" ;;
|
||||||
*) warn "${workflow}: only 'contents: read' and weaker permissions are allowed at top level; if you want to use stronger permissions, please set job-level permissions" ;;
|
*) error "${workflow}: only 'contents: read' and weaker permissions are allowed at top level; if you want to use stronger permissions, please set job-level permissions" ;;
|
||||||
esac
|
esac
|
||||||
# Make sure the 'needs' section is not out of date.
|
# Make sure the 'needs' section is not out of date.
|
||||||
if grep -q '# tidy:needs' "${workflow}" && ! grep -Eq '# *needs: \[' "${workflow}"; then
|
if grep -q '# tidy:needs' "${workflow}" && ! grep -Eq '# *needs: \[' "${workflow}"; then
|
||||||
@@ -117,7 +130,7 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
|
|||||||
printf -v jobs '%s, ' "${jobs_actual[@]}"
|
printf -v jobs '%s, ' "${jobs_actual[@]}"
|
||||||
sed -i "s/needs: \[.*\] # tidy:needs/needs: [${jobs%, }] # tidy:needs/" "${workflow}"
|
sed -i "s/needs: \[.*\] # tidy:needs/needs: [${jobs%, }] # tidy:needs/" "${workflow}"
|
||||||
check_diff "${workflow}"
|
check_diff "${workflow}"
|
||||||
warn "${workflow}: please update 'needs' section in 'ci-success' job"
|
error "${workflow}: please update 'needs' section in 'ci-success' job"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
@@ -127,7 +140,7 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ -n "$(git ls-files '*.yaml')" ]]; then
|
if [[ -n "$(git ls-files '*.yaml')" ]]; then
|
||||||
warn "please use '.yml' instead of '.yaml' for consistency"
|
error "please use '.yml' instead of '.yaml' for consistency"
|
||||||
git ls-files '*.yaml'
|
git ls-files '*.yaml'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -199,7 +212,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
dup=$(sed '/^$/d' .github/.cspell/project-dictionary.txt "${dictionary}" | LC_ALL=C sort -f | uniq -d -i | (grep -v '//.*' || true))
|
dup=$(sed '/^$/d' .github/.cspell/project-dictionary.txt "${dictionary}" | LC_ALL=C sort -f | uniq -d -i | (grep -v '//.*' || true))
|
||||||
if [[ -n "${dup}" ]]; then
|
if [[ -n "${dup}" ]]; then
|
||||||
warn "duplicated words in dictionaries; please remove the following words from .github/.cspell/project-dictionary.txt"
|
error "duplicated words in dictionaries; please remove the following words from .github/.cspell/project-dictionary.txt"
|
||||||
echo "======================================="
|
echo "======================================="
|
||||||
echo "${dup}"
|
echo "${dup}"
|
||||||
echo "======================================="
|
echo "======================================="
|
||||||
|
|||||||
Reference in New Issue
Block a user