[ci]Upgrade to check-spelling 0.0.20alpha7 (#19127)

* spelling: added

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: and

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: another

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: color

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: file

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: not

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurrences

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: stamp

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: suppressions

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: up to

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: whether

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: whichdoes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* Upgrade check-spelling to v0.0.20-alpha7

Config based on:
a5001170a7

* Adding duplicate detection to patterns.txt
* Adding line_forbidden.patterns
* Adding reject.txt
* Updated excludes (and sorted)
* Switching to unified workflow

* moving `wil` to allow.txt to clarify that it's a term of art
  (https://github.com/microsoft/wil), whereas often it's a typo for `will`.

* Update src/runner/main.cpp

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref
2022-07-01 10:09:41 -04:00
committed by GitHub
parent f4dbdbdd7a
commit 3cb0638c7e
37 changed files with 190 additions and 144 deletions

15
.github/actions/spell-check/README.md vendored Normal file
View File

@@ -0,0 +1,15 @@
# check-spelling/check-spelling configuration
File | Purpose | Format | Info
-|-|-|-
[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.

1
.github/actions/spell-check/allow.txt vendored Normal file
View File

@@ -0,0 +1 @@
wil

View File

@@ -1,13 +1,15 @@
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
(?:^|/)monacoSRC/
(?:^|/)MonacoPreviewHandler/customLanguages/
(?:^|/)MonacoPreviewHandler/monaco_languages.json
(?:^|/)MonacoPreviewHandler/index.html
(?:^|/)MonacoPreviewHandler/generateLanguagesJson.html
(?:^|/)MonacoPreviewHandler/monacoSpecialLanguages.js
(?:^|/)(?i)COPYRIGHT
(?:^|/)(?i)LICEN[CS]E
(?:^|/)package(?:-lock)\.json$
(?:^|/)go\.sum$
(?:^|/)MonacoPreviewHandler/customLanguages/
(?:^|/)MonacoPreviewHandler/generateLanguagesJson.html
(?:^|/)MonacoPreviewHandler/index.html
(?:^|/)MonacoPreviewHandler/monacoSpecialLanguages.js
(?:^|/)MonacoPreviewHandler/monaco_languages.json
(?:^|/)monacoSRC/
(?:^|/)package(?:-lock|)\.json$
(?:^|/)timezones\.json$
(?:^|/)vendor/
(?:^|/)WindowsSettings\.json$
/package(?:-lock|)\.json$
@@ -16,24 +18,44 @@
ignore$
[/.][a-z]{2}(?:-[a-zA-Z]{2}|)\.
\.ai$
\.avi$
\.bmp$
\.bz2$
\.crt$
\.dat$
\.dll$
\.DS_Store$
\.eot$
\.filters$
\.gcode$
\.gif$
\.gitattributes$
\.gitignore$
\.graffle$
\.gz$
\.icns$
\.ico$
\.jpg$
\.jar$
\.jpe?g$
\.key$
\.lcl$
\.lock$
\.min\.
\.map$
\.min\..
\.mod$
\.mp[34]$
\.ocf$
\.otf$
\.pdf$
\.pem$
\.PNG$
\.png$
\.psd$
\.stl$
\.woff$
\.svg$
\.ttf$
\.wav$
\.woff2?$
\.zip$
^doc/devdocs/akaLinks\.md$
^installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe$
@@ -52,6 +74,4 @@ ignore$
^\.github/
^\.github/actions/spell-check/
^\.gitmodules$
(?:^|/)WindowsSettings\.json$
(?:^|/)timezones\.json$
^\Q.pipelines/ESRPSigning_core.json\E$

View File

@@ -20,6 +20,7 @@ actioned
activatable
ACTIVATEAPP
activationaction
adamchilders
ADDUNDORECORD
ADifferent
ADMINS
@@ -94,7 +95,6 @@ ARPPRODUCTICON
ARRAYSIZE
arsinh
artanh
Artboard
Artsakh
asdf
AShortcut
@@ -133,6 +133,7 @@ awakeness
awakeversion
AWAYMODE
AYUV
azchohfi
backend
backtracer
BADD
@@ -190,7 +191,6 @@ Bto
buf
BUFSIZE
bugreport
BUILDARCH
BUILDNUMBER
buildtask
buildtransitive
@@ -268,7 +268,6 @@ cnt
Cocklebiddy
coclass
codebase
codecvt
CODENAME
codeofconduct
codereview
@@ -299,7 +298,6 @@ comsuppw
comsuppwd
comutil
Concat
concrt
configs
Configurator
CONFLICTINGMODIFIERKEY
@@ -337,6 +335,7 @@ crlf
cron
Crossdevice
CRSEL
crutkas
CSearch
CSettings
csharp
@@ -439,11 +438,9 @@ devblogs
devdocs
devenum
DEVMON
devops
devpkey
DEVSOURCE
dhcp
diffing
difftime
DIIRFLAG
dimm
@@ -460,7 +457,6 @@ DLGMODALFRAME
dlib
dllexport
dllhost
dllimport
dllmain
dlls
DNLEN
@@ -494,9 +490,9 @@ DWINRT
dwl
dwm
dwmapi
dwmcorei
DWMCOLORIZATIONCOLORCHANGED
DWMCOMPOSITIONCHANGED
dwmcorei
DWMNCRENDERINGCHANGED
Dwmp
DWMSENDICONICLIVEPREVIEWBITMAP
@@ -524,6 +520,7 @@ EFile
ekus
elif
elseif
eltociear
Emoji
emptyrecyclebin
ENABLEDPOPUP
@@ -538,7 +535,7 @@ entrypoint
ENU
enum
EOAC
eol
EOL
epicgames
Eqn
ERASEBKGND
@@ -683,6 +680,7 @@ hanselman
hardcoded
Hardlines
HARDWAREINPUT
harvastum
hashcode
Hashset
Hashtable
@@ -743,7 +741,6 @@ homljgmgpmcbpjbnjpfijnhipfkiclkd
HOOKPROC
Hostbackdropbrush
hostname
hotfix
hotkeycontrol
hotkeys
hotlight
@@ -867,7 +864,6 @@ IMedia
IMem
IMessage
imeutil
iminstall
IMoniker
IMouse
impl
@@ -985,7 +981,6 @@ IVector
IView
IVirtual
IWbem
IWeb
IWIC
iwindow
IWork
@@ -1079,7 +1074,6 @@ LIBID
Lifecycle
LIGHTORANGE
LIGHTTURQUOISE
lightunplated
lindex
linkedin
linq
@@ -1288,7 +1282,6 @@ msp
msrc
mst
msvc
msvcp
MTND
Mul
multiline
@@ -1424,7 +1417,6 @@ Objbase
OBJID
objidl
oblitum
octodex
odbc
odbccp
Oem
@@ -1459,7 +1451,6 @@ OSVERSIONINFOEX
OSVERSIONINFOEXW
OSVERSIONINFOW
osvi
otating
OUTOFCONTEXT
OUTOFMEMORY
outpin
@@ -1498,7 +1489,6 @@ PCIDLIST
PCWSTR
pdb
pdbonly
pde
pdfpreviewhandler
pdo
pdto
@@ -1653,6 +1643,7 @@ RBUTTONDBLCLK
RBUTTONDOWN
RBUTTONUP
rclsid
rcmaehl
RCONTROL
RCtrl
readme
@@ -1752,8 +1743,6 @@ RTB
RTCS
RTLREADING
RTSS
ruleset
RUNACTIVEXCTLS
runas
rundll
rungameid
@@ -1816,6 +1805,7 @@ SETWORKAREA
sfgao
SFGAOF
SFP
shandsj
sharpkeys
SHCNE
SHCNF
@@ -1864,6 +1854,7 @@ SIGABRT
sigdn
SIGNINGSCENARIO
signtool
sinclairinat
SINGLEKEY
singlekeyremapcontrol
singletones
@@ -1877,7 +1868,6 @@ SIZENWSE
sizeof
sizeread
SIZEWE
sketchapp
SKIPOWNPROCESS
sku
SLGP
@@ -1885,6 +1875,7 @@ sln
SMALLICON
SMTO
snd
snickler
snwprintf
softline
somil
@@ -1982,7 +1973,6 @@ subquery
substr
Sul
Superbar
supressions
Suri
sut
SVE
@@ -2054,7 +2044,6 @@ THH
THICKFRAME
THISCOMPONENT
THotkey
thre
TILEDWINDOW
timedate
timediff
@@ -2091,7 +2080,6 @@ TRK
trl
trunc
Tshuapa
tspan
TStr
Tuva
TValue
@@ -2184,14 +2172,10 @@ uxtheme
UYVY
validmodulename
vcamp
vccorlib
vcdl
VCINSTALLDIR
vcm
vcomp
vcredist
VCRT
vcruntime
vcvars
VDesktop
vdi
@@ -2262,13 +2246,11 @@ wekyb
Wevtapi
wformat
wgpocpl
Whichdoes
whitespaces
WIC
wifi
wiki
wikipedia
wil
wildcards
winapi
winappdriver
@@ -2277,7 +2259,6 @@ Wincodecsdk
wincolor
windef
windir
Windowcontrols
WINDOWCREATED
WINDOWEDGE
WINDOWNAME
@@ -2285,8 +2266,6 @@ WINDOWPLACEMENT
WINDOWPOSCHANGED
WINDOWPOSCHANGING
Windowsapp
windowsappruntimeinstall
windowsappsdk
WINDOWSBUILDNUMBER
Windowscodecs
windowsdesktop

View File

@@ -0,0 +1,32 @@
# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
# \bm_data\b
# 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. otherwise
\bother wise\b
# s.b. nonexistent
\bnon existing\b
# s.b. preexisting
[Pp]re-existing
# s.b. preemptively
[Pp]re-emptively
# Reject duplicate words
\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s

View File

@@ -43,8 +43,6 @@ Hash="[0-9A-F]{40}"
# hex digits including css/html color classes:
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23|L")[0-9a-fA-FgGrR_]{2,}(?:[uU]?[lL]{0,2}|u\d+)\b
# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b
(?:L"[abAB]+", ){3}L"[abAB]+"
"Lorem[^"]+?\."
TestCase\("[^"]+"
@@ -105,3 +103,14 @@ http://tes/
# tar arguments
\b(?:\\n|)tar(?:\s+-[a-zA-Z]+|\s[a-z]+)+
# acceptable duplicates
# /bin/ls -l output
[-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
# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b

10
.github/actions/spell-check/reject.txt vendored Normal file
View File

@@ -0,0 +1,10 @@
^attache$
benefitting
occurences?
^dependan.*
^oer$
Sorce
^[Ss]pae.*
^untill$
^untilling$
^wether.*

View File

@@ -12,8 +12,9 @@ jobs:
permissions:
contents: read
pull-requests: read
actions: read
outputs:
internal_state_directory: ${{ steps.spelling.outputs.internal_state_directory }}
followup: ${{ steps.spelling.outputs.followup }}
runs-on: ubuntu-latest
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
concurrency:
@@ -21,35 +22,19 @@ jobs:
# note: If you use only_check_changed_files, you do not want cancel-in-progress
cancel-in-progress: true
steps:
- name: checkout-merge
if: "contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2
with:
ref: refs/pull/${{github.event.pull_request.number}}/merge
- name: checkout
if: github.event_name == 'push'
uses: actions/checkout@v2
- name: check-spelling
id: spelling
uses: check-spelling/check-spelling@v0.0.20-alpha3
uses: check-spelling/check-spelling@v0.0.20-alpha7
with:
config: .github/actions/spell-check
suppress_push_for_open_pull_request: 1
checkout: true
post_comment: 0
dictionary_source_prefixes: '{"cspell": "https://raw.githubusercontent.com/check-spelling/cspell-dicts/master/dictionaries/"}'
extra_dictionaries:
cspell:filetypes/filetypes.txt
cspell:html/html.txt
cspell:css/css.txt
check_extra_dictionaries: ''
- name: store-comment
if: failure()
uses: actions/upload-artifact@v2
with:
retention-days: 1
name: "check-spelling-comment-${{ github.run_id }}"
path: |
${{ steps.spelling.outputs.internal_state_directory }}
comment:
name: Comment
@@ -58,21 +43,16 @@ jobs:
permissions:
contents: write
pull-requests: write
if: always() && needs.spelling.result == 'failure' && needs.spelling.outputs.internal_state_directory
if: (success() || failure()) && needs.spelling.outputs.followup
steps:
- name: checkout
uses: actions/checkout@v2
- name: set up
run: |
mkdir /tmp/data
- name: retrieve-comment
uses: actions/download-artifact@v2
with:
name: "check-spelling-comment-${{ github.run_id }}"
path: /tmp/data
- name: comment
uses: check-spelling/check-spelling@v0.0.20-alpha3
uses: check-spelling/check-spelling@v0.0.20-alpha7
with:
config: .github/actions/spell-check
custom_task: comment
internal_state_directory: /tmp/data
checkout: true
task: ${{ needs.spelling.outputs.followup }}
extra_dictionaries:
cspell:filetypes/filetypes.txt
cspell:html/html.txt
cspell:css/css.txt
check_extra_dictionaries: ''