From e1838db15684f2fe40ca929f6eac824214cbe3d3 Mon Sep 17 00:00:00 2001 From: Ashwin Maroli Date: Sun, 10 Oct 2021 12:55:55 +0530 Subject: [PATCH] Update spell-check workflow configuration --- .github/actions/spelling/README.md | 4 ++-- .github/actions/spelling/advice.md | 1 + .github/actions/spelling/excludes.txt | 4 ++++ .github/actions/spelling/expect.txt | 3 ++- .github/actions/spelling/patterns.txt | 11 ++++++++++ .github/workflows/spelling.yml | 29 +++++++++++++++------------ 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md index ec59bd73..71d377ce 100644 --- a/.github/actions/spelling/README.md +++ b/.github/actions/spelling/README.md @@ -11,5 +11,5 @@ File | Purpose | Format | Info [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.txt](advice.txt) | 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. +Note: you can replace any of these files with a directory by the same name (minus the `.txt` extension) and +then include multiple files (with a `.txt` extension) inside that directory to merge multiple files together. diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md index 2a32b652..5cde8ef2 100644 --- a/.github/actions/spelling/advice.md +++ b/.github/actions/spelling/advice.md @@ -1,4 +1,5 @@ +
If you see a bunch of garbage If it relates to a ... diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt index 0d035882..9b9ae8cd 100644 --- a/.github/actions/spelling/excludes.txt +++ b/.github/actions/spelling/excludes.txt @@ -1,10 +1,13 @@ # See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes + (?:^|/)(?i)COPYRIGHT (?:^|/)(?i)LICEN[CS]E (?:^|/)package(?:-lock|)\.json$ (?:^|/)vendor/ + /fonts/ ignore$ + \.avi$ \.eot$ \.ico$ @@ -20,6 +23,7 @@ ignore$ \.wav$ \.woff$ \.woff2$ + ^docs/pages/redirects/github\.html$ ^lib/jekyll/mime\.types$ ^lib/theme_template/example/index\.html$ diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 7e522068..893b3f21 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -158,6 +158,7 @@ Emacs emails emoji endcapture +endcomment endfor endhighlight endif @@ -165,7 +166,7 @@ endraw endrender endtablerow Enumerables -eol +EOL erb errordocument Espinaco diff --git a/.github/actions/spelling/patterns.txt b/.github/actions/spelling/patterns.txt index b4c2bffc..ae5c5e2a 100644 --- a/.github/actions/spelling/patterns.txt +++ b/.github/actions/spelling/patterns.txt @@ -9,31 +9,42 @@ https?://(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|playlist\?list=| <\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"] \bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]* youtube_id:\s*[-a-zA-Z0-9?&=_]* + # Google Analytics \bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]* + # Google APIs \bgoogleapis\.com/[a-z]+/v\d+/[a-z]+/[@./?=\w]+ \b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|) + # Google Calendar \bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+ \w+\@group\.calendar\.google\.com\b + # Google DataStudio \bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|) + # The leading `/` here is as opposed to the `\b` above # ... a short way to match `https://` or `http://` since most urls have one of those prefixes # Google Docs /docs\.google\.com/[a-z]+/d/(?:e/|)[0-9a-zA-Z_-]+/? + # Google Groups https://groups\.google\.com/d/topic/[^/]+/[a-zA-Z0-9]+/discussion https://groups\.google\.com/d/msg/[^/]+/[a-zA-Z0-9]+/[a-zA-Z0-9]+ + # Google themes themes\.googleusercontent\.com/static/fonts/[^/]+/v\d+/[^.]+. + # Google CDN \bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]* + # Goo.gl /goo\.gl/[a-zA-Z0-9]+ + # Google Chrome Store \bchrome\.google\.com/webstore/detail/\w*(?:/\w*|) + # google_site_verification: google_site_verification: [-a-zA-Z=;:/0-9+]* diff --git a/.github/workflows/spelling.yml b/.github/workflows/spelling.yml index e3825f33..589b05db 100644 --- a/.github/workflows/spelling.yml +++ b/.github/workflows/spelling.yml @@ -1,19 +1,22 @@ -name: Spell checking +name: Spell Check on: - pull_request_target: push: + branches: + - master + - "*-stable" + # Switch from `pull_request_target` event to reduce distraction from comments + # regarding errors reported in unmodified files. + pull_request: + branches: + - master + - "*-stable" jobs: build: - name: Spell checking - runs-on: ubuntu-latest + name: Spell Check + runs-on: "ubuntu-latest" steps: - - name: checkout-merge - if: "contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2.0.0 - with: - ref: refs/pull/${{github.event.pull_request.number}}/merge - - name: checkout - if: "!contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2.0.0 - - uses: check-spelling/check-spelling@v0.0.19 + - name: Checkout Repository + uses: actions/checkout@v2 + - name: Check Spellings + uses: check-spelling/check-spelling@v0.0.19