From f4ba1736b397774b166ccfd24105421d5f16edaa Mon Sep 17 00:00:00 2001
From: Josh Soref <2119212+jsoref@users.noreply.github.com>
Date: Tue, 30 Aug 2022 21:12:50 -0400
Subject: [PATCH] Update check-spelling to v0.0.20
---
.github/actions/spelling-data/README.md | 16 ++++++
.github/actions/spelling-data/advice.md | 25 +++++++++
.github/actions/spelling-data/allow.txt | 4 ++
.github/actions/spelling-data/excludes.txt | 50 ++++++++++++++++-
.github/actions/spelling-data/expect.txt | 4 +-
.../spelling-data/line_forbidden.patterns | 56 +++++++++++++++++++
.github/actions/spelling-data/patterns.txt | 24 +++++++-
.github/actions/spelling-data/reject.txt | 10 ++++
.github/workflows/spelling.yml | 48 ++++++++++++----
9 files changed, 220 insertions(+), 17 deletions(-)
create mode 100644 .github/actions/spelling-data/README.md
create mode 100644 .github/actions/spelling-data/advice.md
create mode 100644 .github/actions/spelling-data/allow.txt
create mode 100644 .github/actions/spelling-data/line_forbidden.patterns
create mode 100644 .github/actions/spelling-data/reject.txt
diff --git a/.github/actions/spelling-data/README.md b/.github/actions/spelling-data/README.md
new file mode 100644
index 0000000..d82bed7
--- /dev/null
+++ b/.github/actions/spelling-data/README.md
@@ -0,0 +1,16 @@
+# check-spelling/check-spelling configuration
+
+File | Purpose | Format | Info
+-|-|-|-
+[dictionary.txt](dictionary.txt) | Replacement dictionary (creating this file will override the default dictionary) | one word per line | [dictionary](https://github.com/check-spelling/check-spelling/wiki/Configuration#dictionary)
+[allow.txt](allow.txt) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow)
+[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject)
+[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes)
+[only.txt](only.txt) | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only)
+[patterns.txt](patterns.txt) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
+[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
+[expect.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect)
+[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice)
+
+Note: you can replace any of these files with a directory by the same name (minus the suffix)
+and then include multiple files inside that directory (with that suffix) to merge multiple files together.
diff --git a/.github/actions/spelling-data/advice.md b/.github/actions/spelling-data/advice.md
new file mode 100644
index 0000000..54f0c9b
--- /dev/null
+++ b/.github/actions/spelling-data/advice.md
@@ -0,0 +1,25 @@
+
+If the flagged items are false positives
+
+If items relate to a ...
+* binary file (or some other file you wouldn't want to check at all).
+
+ Please add a file path to the `excludes.txt` file matching the containing file.
+
+ File paths are Perl 5 Regular Expressions - you can [test](
+https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files.
+
+ `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md](
+../tree/HEAD/README.md) (on whichever branch you're using).
+
+* well-formed pattern.
+
+ If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it,
+ try adding it to the `patterns.txt` file.
+
+ Patterns are Perl 5 Regular Expressions - you can [test](
+https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines.
+
+ Note that patterns can't match multiline strings.
+
+
diff --git a/.github/actions/spelling-data/allow.txt b/.github/actions/spelling-data/allow.txt
new file mode 100644
index 0000000..494d4de
--- /dev/null
+++ b/.github/actions/spelling-data/allow.txt
@@ -0,0 +1,4 @@
+github
+https
+ssh
+ubuntu
diff --git a/.github/actions/spelling-data/excludes.txt b/.github/actions/spelling-data/excludes.txt
index 70833a1..2b1f698 100644
--- a/.github/actions/spelling-data/excludes.txt
+++ b/.github/actions/spelling-data/excludes.txt
@@ -1,3 +1,51 @@
+# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
+(?:^|/)(?i)COPYRIGHT
+(?:^|/)(?i)LICEN[CS]E
+(?:^|/)go\.sum$
+(?:^|/)package(?:-lock|)\.json$
+(?:^|/)vendor/
+ignore$
+\.a$
+\.ai$
+\.avi$
+\.bmp$
+\.bz2$
+\.crt$
+\.dll$
+\.DS_Store$
+\.eot$
+\.exe$
+\.gif$
+\.gitattributes$
+\.graffle$
+\.gz$
+\.icns$
+\.ico$
+\.jar$
+\.jpe?g$
+\.key$
+\.lib$
+\.lock$
+\.map$
+\.min\..
+\.mod$
+\.mp[34]$
+\.o$
+\.ocf$
+\.otf$
+\.pdf$
+\.pem$
+\.png$
+\.psd$
+\.s$
+\.svg$
+\.tiff?$
+\.ttf$
+\.wav$
+\.webm$
+\.webp$
+\.woff2?$
+\.zip$
/values\.yaml$
-\.[^./]*ignore$
^\.github/actions/spelling-data/
+^\Q.github/workflows/spelling.yml\E$
diff --git a/.github/actions/spelling-data/expect.txt b/.github/actions/spelling-data/expect.txt
index 454c2ec..56eebdc 100644
--- a/.github/actions/spelling-data/expect.txt
+++ b/.github/actions/spelling-data/expect.txt
@@ -3,13 +3,12 @@ args
config
configmap
Cron
+Envs
filetype
fthomas
fullname
garnercorp
-github
githubusercontent
-helmv
http
kube
kubectl
@@ -29,7 +28,6 @@ scalafix
stefanprodan
tpl
trunc
-ubuntu
unshallow
Workflow
www
diff --git a/.github/actions/spelling-data/line_forbidden.patterns b/.github/actions/spelling-data/line_forbidden.patterns
new file mode 100644
index 0000000..58e9252
--- /dev/null
+++ b/.github/actions/spelling-data/line_forbidden.patterns
@@ -0,0 +1,56 @@
+# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
+# \bm_data\b
+
+# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test,
+# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want
+# to use this:
+#\bfit\(
+
+# s.b. GitHub
+\bGithub\b
+
+# s.b. GitLab
+\bGitlab\b
+
+# s.b. JavaScript
+\bJavascript\b
+
+# s.b. Microsoft
+\bMicroSoft\b
+
+# s.b. another
+\ban[- ]other\b
+
+# s.b. greater than
+\bgreater then\b
+
+# s.b. into
+\bin to\b
+
+# s.b. less than
+\bless then\b
+
+# s.b. otherwise
+\bother[- ]wise\b
+
+# s.b. nonexistent
+\bnon existing\b
+\b[Nn]o[nt][- ]existent\b
+
+# s.b. preexisting
+[Pp]re-existing
+
+# s.b. preempt
+[Pp]re-empt\b
+
+# s.b. preemptively
+[Pp]re-emptively
+
+# s.b. reentrancy
+[Rr]e-entrancy
+
+# s.b. reentrant
+[Rr]e-entrant
+
+# Reject duplicate words
+\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s
diff --git a/.github/actions/spelling-data/patterns.txt b/.github/actions/spelling-data/patterns.txt
index aed9665..aad3e35 100644
--- a/.github/actions/spelling-data/patterns.txt
+++ b/.github/actions/spelling-data/patterns.txt
@@ -1 +1,23 @@
-\b([A-Za-z])\1{3,}\b
+# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns
+
+# Automatically suggested patterns
+# hit-count: 2 file-count: 2
+# version suffix v#
+(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_]))
+
+# acceptable duplicates
+# ls directory listings
+[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+
+# C types
+\s(long|LONG) \g{-1}\s
+# javadoc / .net
+(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s
+
+# Commit message -- Signed-off-by and friends
+^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$
+
+# Autogenerated revert commit message
+^This reverts commit [0-9a-f]{40}\.$
+
+# ignore long runs of a single character:
+\b([A-Za-z])\g{-1}{3,}\b
diff --git a/.github/actions/spelling-data/reject.txt b/.github/actions/spelling-data/reject.txt
new file mode 100644
index 0000000..b5a6d36
--- /dev/null
+++ b/.github/actions/spelling-data/reject.txt
@@ -0,0 +1,10 @@
+^attache$
+benefitting
+occurences?
+^dependan.*
+^oer$
+Sorce
+^[Ss]pae.*
+^untill$
+^untilling$
+^wether.*
diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml
index 6ace0aa..8983a92 100644
--- a/.github/workflows/spelling.yml
+++ b/.github/workflows/spelling.yml
@@ -2,22 +2,46 @@ name: Spell checking
on:
push:
- branches:
- - "**"
- tags-ignore:
- - "**"
+ branches: ["**"]
+ tags-ignore: ["**"]
jobs:
- build:
+ spelling:
name: Spell checking
+ permissions:
+ contents: read
+ pull-requests: read
+ actions: read
+ outputs:
+ followup: ${{ steps.spelling.outputs.followup }}
runs-on: ubuntu-latest
+ if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
+ concurrency:
+ group: spelling-${{ github.event.pull_request.number || github.ref }}
+ # note: If you use only_check_changed_files, you do not want cancel-in-progress
+ cancel-in-progress: true
steps:
- - uses: actions/checkout@v2.0.0
+ - name: check-spelling
+ id: spelling
+ uses: check-spelling/check-spelling@v0.0.20
with:
- fetch-depth: 2
- - uses: check-spelling/check-spelling@0.0.16-alpha
- env:
- bucket: .github/actions
- project: spelling-data
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ config: .github/actions/spelling-data
+ checkout: true
+ check_extra_dictionaries: ''
+ post_comment: 0
+ comment:
+ name: Report
+ runs-on: ubuntu-latest
+ needs: spelling
+ permissions:
+ contents: write
+ pull-requests: write
+ if: (success() || failure()) && needs.spelling.outputs.followup
+ steps:
+ - name: comment
+ uses: check-spelling/check-spelling@v0.0.20
+ with:
+ config: .github/actions/spelling-data
+ checkout: true
+ task: ${{ needs.spelling.outputs.followup }}