mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-14 08:20:27 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0b89cda51 | ||
|
|
9e5260f1db | ||
|
|
a4cdfee82b | ||
|
|
71bb81889c | ||
|
|
4f363552df | ||
|
|
60c0a46993 | ||
|
|
5129b57152 | ||
|
|
3cd0f0ed94 | ||
|
|
1fe1e0ef01 | ||
|
|
7ef4fec011 | ||
|
|
a6cd5fac26 | ||
|
|
e0b88e5cc1 | ||
|
|
2402df67ca | ||
|
|
4d6942468f |
7
.github/.cspell/organization-dictionary.txt
vendored
7
.github/.cspell/organization-dictionary.txt
vendored
@@ -67,6 +67,7 @@ openwrt
|
|||||||
riscv
|
riscv
|
||||||
softfloat
|
softfloat
|
||||||
sparcv
|
sparcv
|
||||||
|
spirv
|
||||||
thumbeb
|
thumbeb
|
||||||
thumbebv
|
thumbebv
|
||||||
thumbv
|
thumbv
|
||||||
@@ -89,12 +90,14 @@ bools
|
|||||||
builtins
|
builtins
|
||||||
bytecount
|
bytecount
|
||||||
canonicalize
|
canonicalize
|
||||||
|
concat
|
||||||
consts
|
consts
|
||||||
ctypes
|
ctypes
|
||||||
dealloc
|
dealloc
|
||||||
deque
|
deque
|
||||||
docsrs
|
docsrs
|
||||||
doctest
|
doctest
|
||||||
|
doctests
|
||||||
hasher
|
hasher
|
||||||
impls
|
impls
|
||||||
inlateout
|
inlateout
|
||||||
@@ -135,8 +138,11 @@ binutils
|
|||||||
connrefused
|
connrefused
|
||||||
cygwin
|
cygwin
|
||||||
dpkg
|
dpkg
|
||||||
|
elif
|
||||||
endianness
|
endianness
|
||||||
|
esac
|
||||||
euxo
|
euxo
|
||||||
|
gsub
|
||||||
msys
|
msys
|
||||||
noninteractive
|
noninteractive
|
||||||
noprofile
|
noprofile
|
||||||
@@ -148,6 +154,7 @@ powerset
|
|||||||
proto
|
proto
|
||||||
ranlib
|
ranlib
|
||||||
readelf
|
readelf
|
||||||
|
shellcheckrc
|
||||||
SIGABRT
|
SIGABRT
|
||||||
SIGILL
|
SIGILL
|
||||||
SIGINT
|
SIGINT
|
||||||
|
|||||||
7
.github/.cspell/project-dictionary.txt
vendored
7
.github/.cspell/project-dictionary.txt
vendored
@@ -1,5 +1,4 @@
|
|||||||
binstall
|
binstall
|
||||||
bytecodealliance
|
|
||||||
coreutils
|
coreutils
|
||||||
distro
|
distro
|
||||||
doas
|
doas
|
||||||
@@ -7,21 +6,15 @@ dprint
|
|||||||
enablerepo
|
enablerepo
|
||||||
epel
|
epel
|
||||||
grcov
|
grcov
|
||||||
jfrimmel
|
|
||||||
koalaman
|
|
||||||
libc
|
libc
|
||||||
linkcheck
|
linkcheck
|
||||||
mdbook
|
mdbook
|
||||||
microdnf
|
microdnf
|
||||||
mvdan
|
|
||||||
nextest
|
nextest
|
||||||
protobuf
|
|
||||||
protoc
|
protoc
|
||||||
protocolbuffers
|
|
||||||
pwsh
|
pwsh
|
||||||
quickinstall
|
quickinstall
|
||||||
rockylinux
|
rockylinux
|
||||||
rustwasm
|
|
||||||
shellcheck
|
shellcheck
|
||||||
shfmt
|
shfmt
|
||||||
udeps
|
udeps
|
||||||
|
|||||||
27
CHANGELOG.md
27
CHANGELOG.md
@@ -10,6 +10,26 @@ Note: In this file, do not use the hard wrap in the middle of a sentence for com
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.6.13] - 2023-04-13
|
||||||
|
|
||||||
|
- Update `protoc@latest` to 3.22.3.
|
||||||
|
|
||||||
|
## [2.6.12] - 2023-04-12
|
||||||
|
|
||||||
|
- Update `cargo-deny@latest` to 0.13.9.
|
||||||
|
|
||||||
|
## [2.6.11] - 2023-04-11
|
||||||
|
|
||||||
|
- Update `dprint@latest` to 0.35.4.
|
||||||
|
|
||||||
|
## [2.6.10] - 2023-04-07
|
||||||
|
|
||||||
|
- Update `cargo-deny@latest` to 0.13.8.
|
||||||
|
|
||||||
|
## [2.6.9] - 2023-04-05
|
||||||
|
|
||||||
|
- Update `cargo-llvm-cov@latest` to 0.5.14.
|
||||||
|
|
||||||
## [2.6.8] - 2023-04-05
|
## [2.6.8] - 2023-04-05
|
||||||
|
|
||||||
- Update `cargo-tarpaulin@latest` to 0.25.2.
|
- Update `cargo-tarpaulin@latest` to 0.25.2.
|
||||||
@@ -711,7 +731,12 @@ Note: This release is considered a breaking change because installing on version
|
|||||||
|
|
||||||
Initial release
|
Initial release
|
||||||
|
|
||||||
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.6.8...HEAD
|
[Unreleased]: https://github.com/taiki-e/install-action/compare/v2.6.13...HEAD
|
||||||
|
[2.6.13]: https://github.com/taiki-e/install-action/compare/v2.6.12...v2.6.13
|
||||||
|
[2.6.12]: https://github.com/taiki-e/install-action/compare/v2.6.11...v2.6.12
|
||||||
|
[2.6.11]: https://github.com/taiki-e/install-action/compare/v2.6.10...v2.6.11
|
||||||
|
[2.6.10]: https://github.com/taiki-e/install-action/compare/v2.6.9...v2.6.10
|
||||||
|
[2.6.9]: https://github.com/taiki-e/install-action/compare/v2.6.8...v2.6.9
|
||||||
[2.6.8]: https://github.com/taiki-e/install-action/compare/v2.6.7...v2.6.8
|
[2.6.8]: https://github.com/taiki-e/install-action/compare/v2.6.7...v2.6.8
|
||||||
[2.6.7]: https://github.com/taiki-e/install-action/compare/v2.6.6...v2.6.7
|
[2.6.7]: https://github.com/taiki-e/install-action/compare/v2.6.6...v2.6.7
|
||||||
[2.6.6]: https://github.com/taiki-e/install-action/compare/v2.6.5...v2.6.6
|
[2.6.6]: https://github.com/taiki-e/install-action/compare/v2.6.5...v2.6.6
|
||||||
|
|||||||
32
manifests/cargo-deny.json
generated
32
manifests/cargo-deny.json
generated
@@ -18,10 +18,38 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "0.13.7"
|
"version": "0.13.9"
|
||||||
},
|
},
|
||||||
"0.13": {
|
"0.13": {
|
||||||
"version": "0.13.7"
|
"version": "0.13.9"
|
||||||
|
},
|
||||||
|
"0.13.9": {
|
||||||
|
"x86_64_linux_musl": {
|
||||||
|
"checksum": "77f6b3feab12afc82638cd4c6197c983d249d1afa4180a6b9c933efbf8bff427"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "7b790f7e15dc6bb79dc0a737310f62fc7a4653749e40ec4fa7419ee627a014ed"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "6f6a69d1dbabf98a1d826dd2dbc0bbfd378336ec891b3e7fd8c570744ea6efa3"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "7d4cc49030262296c96076519deefc740e70fbc338ccd9179d4bc9d3be373512"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"0.13.8": {
|
||||||
|
"x86_64_linux_musl": {
|
||||||
|
"checksum": "95b2b7eacc1e93b918969e8d9f25dad49ce079511401308b548f5fceeafeb896"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "950f36ddbb08c0686305f97196b450a99efd3bbea3553746b4f1b9942a5ab2b7"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "5cae60df4ab5a9c949a59f56cf101562b7a962fb2750b5e6aeb47e0d8799e962"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "6eeedd852be234c5b27359e7ce6c7da665511afb5d643c7ce8db660e08ca7bc1"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"0.13.7": {
|
"0.13.7": {
|
||||||
"x86_64_linux_musl": {
|
"x86_64_linux_musl": {
|
||||||
|
|||||||
21
manifests/cargo-llvm-cov.json
generated
21
manifests/cargo-llvm-cov.json
generated
@@ -17,10 +17,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "0.5.13"
|
"version": "0.5.14"
|
||||||
},
|
},
|
||||||
"0.5": {
|
"0.5": {
|
||||||
"version": "0.5.13"
|
"version": "0.5.14"
|
||||||
|
},
|
||||||
|
"0.5.14": {
|
||||||
|
"x86_64_linux_musl": {
|
||||||
|
"checksum": "688e56f78611f7866842f5b86e27672225b28c8a536c75d6c0a3fd67082474ea"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "8d4a93175d5ba0710a46ccab007444cea4c53406b4c0b6c6ae6916d1192ac333"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "5773b119db63bbbcb975ecd3e0c71ae548506d85312248d6d3e94758cf88bba6"
|
||||||
|
},
|
||||||
|
"aarch64_linux_musl": {
|
||||||
|
"checksum": "61b22ff22d95ca6af9c668c780fe2a23a519a44d1fab3de01adadfbb36cea54d"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "f98c5d4bc2f7b67328a82028bb78f0a67436ae81a4e2a7911fd4f18f572c434b"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"0.5.13": {
|
"0.5.13": {
|
||||||
"x86_64_linux_musl": {
|
"x86_64_linux_musl": {
|
||||||
|
|||||||
21
manifests/dprint.json
generated
21
manifests/dprint.json
generated
@@ -20,10 +20,27 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "0.35.3"
|
"version": "0.35.4"
|
||||||
},
|
},
|
||||||
"0.35": {
|
"0.35": {
|
||||||
"version": "0.35.3"
|
"version": "0.35.4"
|
||||||
|
},
|
||||||
|
"0.35.4": {
|
||||||
|
"x86_64_linux_musl": {
|
||||||
|
"checksum": "a061268da99878970993d988b42de6324aea4cdce437fc1ca46ec51add4162dd"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"checksum": "179234c542ffc1f26e2dffc62884809d1fd0e781b49f95b938410b1b6450c20c"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"checksum": "50ac0366c5c20ace37fa2bef11f8826a5f68c1a28412b7751d89e38d7ce6c709"
|
||||||
|
},
|
||||||
|
"aarch64_linux_gnu": {
|
||||||
|
"checksum": "1a810a4c28934b6e281686ae53fe0e1eba973caec245df8004d4452ffc61d306"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"checksum": "be2a5b698a0a4837a76a7626288a16e1c1f4153463f630845f9def43057f79e2"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"0.35.3": {
|
"0.35.3": {
|
||||||
"x86_64_linux_musl": {
|
"x86_64_linux_musl": {
|
||||||
|
|||||||
28
manifests/protoc.json
generated
28
manifests/protoc.json
generated
@@ -1,13 +1,35 @@
|
|||||||
{
|
{
|
||||||
"template": null,
|
"template": null,
|
||||||
"latest": {
|
"latest": {
|
||||||
"version": "3.22.2"
|
"version": "3.22.3"
|
||||||
},
|
},
|
||||||
"3": {
|
"3": {
|
||||||
"version": "3.22.2"
|
"version": "3.22.3"
|
||||||
},
|
},
|
||||||
"3.22": {
|
"3.22": {
|
||||||
"version": "3.22.2"
|
"version": "3.22.3"
|
||||||
|
},
|
||||||
|
"3.22.3": {
|
||||||
|
"x86_64_linux_gnu": {
|
||||||
|
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-x86_64.zip",
|
||||||
|
"checksum": "0f8070d762eb8a2f5a13a47713a553f989f9d9b556e7e3ebfa2bd6464e2ecaeb"
|
||||||
|
},
|
||||||
|
"x86_64_macos": {
|
||||||
|
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-osx-x86_64.zip",
|
||||||
|
"checksum": "d644a65064a97fa3ed033a4a2314ab35816abbd9aed052f9b1b3374d2deaaae4"
|
||||||
|
},
|
||||||
|
"x86_64_windows": {
|
||||||
|
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-win64.zip",
|
||||||
|
"checksum": "fa7fe21bf6e204a4e1eec3ffee1d53c84e216289bc4762e072258e5bca113a3c"
|
||||||
|
},
|
||||||
|
"aarch64_linux_gnu": {
|
||||||
|
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-linux-aarch_64.zip",
|
||||||
|
"checksum": "c6068d9d151c39723bc7db920759b55737a770b0c2ec544dd0197d4078d7a956"
|
||||||
|
},
|
||||||
|
"aarch64_macos": {
|
||||||
|
"url": "https://github.com/protocolbuffers/protobuf/releases/download/v22.3/protoc-22.3-osx-aarch_64.zip",
|
||||||
|
"checksum": "79cc15d1b528061ea0a818b0abcf3be1e0bdcb063a0cc999af27974cccdc5cce"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"3.22.2": {
|
"3.22.2": {
|
||||||
"x86_64_linux_gnu": {
|
"x86_64_linux_gnu": {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# SPDX-License-Identifier: Apache-2.0 OR MIT
|
||||||
# shellcheck disable=SC2046
|
# shellcheck disable=SC2046
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
IFS=$'\n\t'
|
IFS=$'\n\t'
|
||||||
@@ -33,6 +34,9 @@ check_diff() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
info() {
|
||||||
|
echo >&2 "info: $*"
|
||||||
|
}
|
||||||
warn() {
|
warn() {
|
||||||
if [[ -n "${GITHUB_ACTIONS:-}" ]]; then
|
if [[ -n "${GITHUB_ACTIONS:-}" ]]; then
|
||||||
echo "::warning::$*"
|
echo "::warning::$*"
|
||||||
@@ -60,6 +64,7 @@ fi
|
|||||||
|
|
||||||
# Rust (if exists)
|
# Rust (if exists)
|
||||||
if [[ -n "$(git ls-files '*.rs')" ]]; then
|
if [[ -n "$(git ls-files '*.rs')" ]]; then
|
||||||
|
info "checking Rust code style"
|
||||||
if type -P rustup &>/dev/null; then
|
if type -P rustup &>/dev/null; then
|
||||||
# `cargo fmt` cannot recognize files not included in the current workspace and modules
|
# `cargo fmt` cannot recognize files not included in the current workspace and modules
|
||||||
# defined inside macros, so run rustfmt directly.
|
# defined inside macros, so run rustfmt directly.
|
||||||
@@ -83,10 +88,35 @@ if [[ -n "$(git ls-files '*.rs')" ]]; then
|
|||||||
error "please replace \`.cast()\` with \`.cast::<type_name>()\`:"
|
error "please replace \`.cast()\` with \`.cast::<type_name>()\`:"
|
||||||
echo "${cast_without_turbofish}"
|
echo "${cast_without_turbofish}"
|
||||||
fi
|
fi
|
||||||
|
first='1'
|
||||||
|
for readme in $(git ls-files '*README.md'); do
|
||||||
|
if ! grep -q '^<!-- tidy:crate-doc:start -->' "${readme}"; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
lib="$(dirname "${readme}")/src/lib.rs"
|
||||||
|
if [[ -n "${first}" ]]; then
|
||||||
|
first=''
|
||||||
|
info "checking readme and crate-level doc are synchronized"
|
||||||
|
fi
|
||||||
|
if ! grep -q '^<!-- tidy:crate-doc:end -->' "${readme}"; then
|
||||||
|
bail "missing '<!-- tidy:crate-doc:end -->' comment in ${readme}"
|
||||||
|
fi
|
||||||
|
if ! grep -q '^<!-- tidy:crate-doc:start -->' "${lib}"; then
|
||||||
|
bail "missing '<!-- tidy:crate-doc:start -->' comment in ${lib}"
|
||||||
|
fi
|
||||||
|
if ! grep -q '^<!-- tidy:crate-doc:end -->' "${lib}"; then
|
||||||
|
bail "missing '<!-- tidy:crate-doc:end -->' comment in ${lib}"
|
||||||
|
fi
|
||||||
|
new=$(tr <"${readme}" '\n' '\a' | grep -o '<!-- tidy:crate-doc:start -->.*<!-- tidy:crate-doc:end -->' | sed 's/\&/\\\&/g; s/\\/\\\\/g')
|
||||||
|
new=$(tr <"${lib}" '\n' '\a' | awk -v new="${new}" 'gsub("<!-- tidy:crate-doc:start -->.*<!-- tidy:crate-doc:end -->",new)' | tr '\a' '\n')
|
||||||
|
echo "${new}" >"${lib}"
|
||||||
|
check_diff "${lib}"
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# C/C++ (if exists)
|
# C/C++ (if exists)
|
||||||
if [[ -n "$(git ls-files '*.c')$(git ls-files '*.cpp')" ]]; then
|
if [[ -n "$(git ls-files '*.c')$(git ls-files '*.cpp')" ]]; then
|
||||||
|
info "checking C/C++ code style"
|
||||||
if [[ ! -e .clang-format ]]; then
|
if [[ ! -e .clang-format ]]; then
|
||||||
warn "could not fount .clang-format in the repository root"
|
warn "could not fount .clang-format in the repository root"
|
||||||
fi
|
fi
|
||||||
@@ -101,6 +131,7 @@ fi
|
|||||||
|
|
||||||
# YAML/JavaScript/JSON (if exists)
|
# YAML/JavaScript/JSON (if exists)
|
||||||
if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')" ]]; then
|
if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')" ]]; then
|
||||||
|
info "checking YAML/JavaScript/JSON code style"
|
||||||
if type -P npm &>/dev/null; then
|
if type -P npm &>/dev/null; then
|
||||||
echo "+ npx prettier -l -w \$(git ls-files '*.yml') \$(git ls-files '*.js') \$(git ls-files '*.json')"
|
echo "+ npx prettier -l -w \$(git ls-files '*.yml') \$(git ls-files '*.js') \$(git ls-files '*.json')"
|
||||||
npx prettier -l -w $(git ls-files '*.yml') $(git ls-files '*.js') $(git ls-files '*.json')
|
npx prettier -l -w $(git ls-files '*.yml') $(git ls-files '*.js') $(git ls-files '*.json')
|
||||||
@@ -110,6 +141,7 @@ if [[ -n "$(git ls-files '*.yml')$(git ls-files '*.js')$(git ls-files '*.json')"
|
|||||||
fi
|
fi
|
||||||
# Check GitHub workflows.
|
# Check GitHub workflows.
|
||||||
if [[ -d .github/workflows ]]; then
|
if [[ -d .github/workflows ]]; then
|
||||||
|
info "checking GitHub workflows"
|
||||||
if type -P jq &>/dev/null && type -P yq &>/dev/null; then
|
if type -P jq &>/dev/null && type -P yq &>/dev/null; then
|
||||||
for workflow in .github/workflows/*.yml; do
|
for workflow in .github/workflows/*.yml; do
|
||||||
# The top-level permissions must be weak as they are referenced by all jobs.
|
# The top-level permissions must be weak as they are referenced by all jobs.
|
||||||
@@ -145,6 +177,7 @@ if [[ -n "$(git ls-files '*.yaml')" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Shell scripts
|
# Shell scripts
|
||||||
|
info "checking Shell scripts"
|
||||||
if type -P shfmt &>/dev/null; then
|
if type -P shfmt &>/dev/null; then
|
||||||
echo "+ shfmt -l -w \$(git ls-files '*.sh')"
|
echo "+ shfmt -l -w \$(git ls-files '*.sh')"
|
||||||
shfmt -l -w $(git ls-files '*.sh')
|
shfmt -l -w $(git ls-files '*.sh')
|
||||||
@@ -170,8 +203,11 @@ fi
|
|||||||
|
|
||||||
# Spell check (if config exists)
|
# Spell check (if config exists)
|
||||||
if [[ -f .cspell.json ]]; then
|
if [[ -f .cspell.json ]]; then
|
||||||
|
info "spell checking"
|
||||||
if type -P npm &>/dev/null; then
|
if type -P npm &>/dev/null; then
|
||||||
|
has_rust=''
|
||||||
if [[ -n "$(git ls-files '*Cargo.toml')" ]]; then
|
if [[ -n "$(git ls-files '*Cargo.toml')" ]]; then
|
||||||
|
has_rust='1'
|
||||||
dependencies=''
|
dependencies=''
|
||||||
for manifest_path in $(git ls-files '*Cargo.toml'); do
|
for manifest_path in $(git ls-files '*Cargo.toml'); do
|
||||||
if [[ "${manifest_path}" != "Cargo.toml" ]] && ! grep -Eq '\[workspace\]' "${manifest_path}"; then
|
if [[ "${manifest_path}" != "Cargo.toml" ]] && ! grep -Eq '\[workspace\]' "${manifest_path}"; then
|
||||||
@@ -179,24 +215,27 @@ if [[ -f .cspell.json ]]; then
|
|||||||
fi
|
fi
|
||||||
metadata=$(cargo metadata --format-version=1 --all-features --no-deps --manifest-path "${manifest_path}")
|
metadata=$(cargo metadata --format-version=1 --all-features --no-deps --manifest-path "${manifest_path}")
|
||||||
for id in $(jq <<<"${metadata}" '.workspace_members[]'); do
|
for id in $(jq <<<"${metadata}" '.workspace_members[]'); do
|
||||||
dependencies+=$'\n'
|
dependencies+="$(jq <<<"${metadata}" ".packages[] | select(.id == ${id})" | jq -r '.dependencies[].name')"$'\n'
|
||||||
dependencies+=$(jq <<<"${metadata}" ".packages[] | select(.id == ${id})" | jq -r '.dependencies[].name')
|
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
# shellcheck disable=SC2001
|
# shellcheck disable=SC2001
|
||||||
dependencies=$(sed <<<"${dependencies}" 's/[0-9_-]/\n/g' | LC_ALL=C sort -f -u)
|
dependencies=$(sed <<<"${dependencies}" 's/[0-9_-]/\n/g' | LC_ALL=C sort -f -u)
|
||||||
config_old=$(<.cspell.json)
|
|
||||||
config_new=$(grep <<<"${config_old}" -v ' *//' | jq 'del(.dictionaries[] | select(index("organization-dictionary") | not))' | jq 'del(.dictionaryDefinitions[] | select(.name == "organization-dictionary" | not))')
|
|
||||||
echo "${config_new}" >.cspell.json
|
|
||||||
words=$(npx <<<"${dependencies}" cspell stdin --no-progress --no-summary --words-only --unique || true)
|
|
||||||
echo "${config_old}" >.cspell.json
|
|
||||||
fi
|
fi
|
||||||
|
config_old=$(<.cspell.json)
|
||||||
|
config_new=$(grep <<<"${config_old}" -v ' *//' | jq 'del(.dictionaries[] | select(index("organization-dictionary") | not))' | jq 'del(.dictionaryDefinitions[] | select(.name == "organization-dictionary" | not))')
|
||||||
|
echo "${config_new}" >.cspell.json
|
||||||
|
if [[ -n "${has_rust}" ]]; then
|
||||||
|
dependencies_words=$(npx <<<"${dependencies}" cspell stdin --no-progress --no-summary --words-only --unique || true)
|
||||||
|
fi
|
||||||
|
all_words=$(npx cspell --no-progress --no-summary --words-only --unique $(git ls-files | (grep -v '\.github/\.cspell/project-dictionary\.txt' || true)) || true)
|
||||||
|
# TODO: handle SIGINT
|
||||||
|
echo "${config_old}" >.cspell.json
|
||||||
cat >.github/.cspell/rust-dependencies.txt <<EOF
|
cat >.github/.cspell/rust-dependencies.txt <<EOF
|
||||||
// This file is @generated by $(basename "$0").
|
// This file is @generated by $(basename "$0").
|
||||||
// It is not intended for manual editing.
|
// It is not intended for manual editing.
|
||||||
EOF
|
EOF
|
||||||
if [[ -n "${words:-}" ]]; then
|
if [[ -n "${dependencies_words:-}" ]]; then
|
||||||
echo $'\n'"${words}" >>.github/.cspell/rust-dependencies.txt
|
echo $'\n'"${dependencies_words}" >>.github/.cspell/rust-dependencies.txt
|
||||||
fi
|
fi
|
||||||
check_diff .github/.cspell/rust-dependencies.txt
|
check_diff .github/.cspell/rust-dependencies.txt
|
||||||
if ! grep -Eq "^\.github/\.cspell/rust-dependencies.txt linguist-generated" .gitattributes; then
|
if ! grep -Eq "^\.github/\.cspell/rust-dependencies.txt linguist-generated" .gitattributes; then
|
||||||
@@ -204,8 +243,11 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "+ npx cspell --no-progress --no-summary \$(git ls-files)"
|
echo "+ npx cspell --no-progress --no-summary \$(git ls-files)"
|
||||||
npx cspell --no-progress --no-summary $(git ls-files)
|
if ! npx cspell --no-progress --no-summary $(git ls-files); then
|
||||||
|
error "spellcheck failed: please fix uses of above words or add to .github/.cspell/project-dictionary.txt if correct"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Make sure the project-specific dictionary does not contain duplicated words.
|
||||||
for dictionary in .github/.cspell/*.txt; do
|
for dictionary in .github/.cspell/*.txt; do
|
||||||
if [[ "${dictionary}" == .github/.cspell/project-dictionary.txt ]]; then
|
if [[ "${dictionary}" == .github/.cspell/project-dictionary.txt ]]; then
|
||||||
continue
|
continue
|
||||||
@@ -218,6 +260,20 @@ EOF
|
|||||||
echo "======================================="
|
echo "======================================="
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Make sure the project-specific dictionary does not contain unused words.
|
||||||
|
unused=''
|
||||||
|
for word in $(grep -v '//.*' .github/.cspell/project-dictionary.txt || true); do
|
||||||
|
if ! grep <<<"${all_words}" -Eq -i "^${word}$"; then
|
||||||
|
unused+="${word}"$'\n'
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [[ -n "${unused}" ]]; then
|
||||||
|
error "unused words in dictionaries; please remove the following words from .github/.cspell/project-dictionary.txt"
|
||||||
|
echo "======================================="
|
||||||
|
echo -n "${unused}"
|
||||||
|
echo "======================================="
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
warn "'npm' is not installed"
|
warn "'npm' is not installed"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user