Skip to content

Commit

Permalink
use home-rolled typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilith Hafner authored and Lilith Hafner committed Oct 16, 2023
1 parent 03334fa commit 5b18d98
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ jobs:
with:
persist-credentials: false
- name: Check spelling with typos
uses: crate-ci/typos@master
#uses: crate-ci/typos@master
run: |
set -o pipefail
mkdir -p "${{ runner.temp }}/typos"
RELEASE_ASSET_URL="$(
gh api /repos/crate-ci/typos/releases/latest \
--jq '."assets"[] | select(."name" | test("^typos-.+-x86_64-unknown-linux-musl\\.tar\\.gz$")) | ."browser_download_url"'
)"
wget --secure-protocol=TLSv1_3 --max-redirect=1 --retry-on-host-error --retry-connrefused --tries=3 \
--quiet --output-document=- "${RELEASE_ASSET_URL}" \
| tar -xz -C "${{ runner.temp }}/typos" ./typos
"${{ runner.temp }}/typos/typos" --version
git diff-index --name-only --diff-filter=d -z ${{ github.base_ref }} \
| xargs -0"${{ runner.temp }}/typos/typos" --format json \
| jq --raw-output '"::warning file=\(.path),line=\(.line_num),col=\(.byte_offset)::perhaps \"\(.typo)\" should be \"" + (.corrections // [] | join("\" or \"") + "\".")'

0 comments on commit 5b18d98

Please sign in to comment.