From de0817a7220ff8e4e713794e8ac6fa9c11ea627e Mon Sep 17 00:00:00 2001 From: Christoph Heiss Date: Sun, 5 Jan 2025 18:27:40 +0100 Subject: [PATCH] ci: pr: check for typos Uses typos [0] to check for any spelling mistakes. A few custom rules are needed to ignore some specific words, as one might expect. This will now cause the `pr` workflow to error out if any typos are found. [0] https://github.com/crate-ci/typos Signed-off-by: Christoph Heiss --- .forgejo/workflows/pr.yml | 6 ++++++ .typos.toml | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .typos.toml diff --git a/.forgejo/workflows/pr.yml b/.forgejo/workflows/pr.yml index 662d12a1..9e57ca8e 100644 --- a/.forgejo/workflows/pr.yml +++ b/.forgejo/workflows/pr.yml @@ -19,6 +19,12 @@ jobs: pnpm run lint:remark pnpm run format:prettier git diff --exit-code + - name: run typos + uses: https://github.com/crate-ci/typos@v1.29.4 + with: + write_changes: true + - name: check typos result + run: git diff --exit-code - name: scripts/cli-docs.sh run: | scripts/cli-docs.sh run ${{ env.GITHUB_BASE_REF }} > docs/admin/command-line.md diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..6d273b55 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,20 @@ +# https://github.com/crate-ci/typos/blob/master/docs/reference.md + +# mask some false positives +[default.extend-words] +# ./docs/admin/recommendations.md +Redict = "Redict" +# ./docs/admin/command-line.md +HELO = "HELO" +TABL = "TABL" # weird false-positive +# ./docs/admin/config-cheat-sheet.md +odf = "odf" +# ./docs/contributor/adr/adr-activity-for-like.md +edn = "edn" + +[default] +extend-ignore-identifiers-re = [ + # ./docs/admin/config-cheat-sheet.md + "\\b(ecdhe_)?rsa_with_.*\\b", +] +