mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 03:07:56 +01:00
Update check-spelling (#14873)
* Updating advice
Copying 18764e6cbb/.github/actions/spelling/advice.md
* Update exclusions
* sort exclusions
* exclude .filters files based on updated engine suggestions
* exclude src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag.txt based on updated engine suggestions
* Upgrade check-spelling to v0.0.20-alpha3
Updates patterns to better handle guids
closes #14854
Adds a couple of other patterns:
* publicKeyToken
* @sha256:
* std::wregex
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Jaime Bernardo <jaime@janeasystems.com>
This commit is contained in:
26
.github/actions/spell-check/advice.md
vendored
26
.github/actions/spell-check/advice.md
vendored
@@ -1,27 +1,25 @@
|
||||
<!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
|
||||
<details><summary>If you see a bunch of garbage</summary>
|
||||
<details><summary>If the flagged items do not appear to be text</summary>
|
||||
|
||||
If it relates to a ...
|
||||
<details><summary>well-formed pattern</summary>
|
||||
If items relate to a ...
|
||||
* well-formed pattern.
|
||||
|
||||
See if there's a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it.
|
||||
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.
|
||||
|
||||
If not, try writing one and adding it to the `patterns.txt` file.
|
||||
|
||||
Patterns are Perl 5 Regular Expressions - you can [test](
|
||||
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.
|
||||
</details>
|
||||
<details><summary>binary-ish string</summary>
|
||||
Note that patterns can't match multiline strings.
|
||||
|
||||
Please add a file path to the `excludes.txt` file instead of just accepting the garbage.
|
||||
* binary file.
|
||||
|
||||
File paths are Perl 5 Regular Expressions - you can [test](
|
||||
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](
|
||||
`^` 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).
|
||||
</details>
|
||||
|
||||
</details>
|
||||
|
||||
4
.github/actions/spell-check/excludes.txt
vendored
4
.github/actions/spell-check/excludes.txt
vendored
@@ -3,6 +3,7 @@
|
||||
(?:^|/)(?i)LICEN[CS]E
|
||||
(?:^|/)package(?:-lock)\.json$
|
||||
(?:^|/)vendor/
|
||||
(?:^|/)WindowsSettings\.json$
|
||||
/package(?:-lock|)\.json$
|
||||
/pinyindb/
|
||||
/settings-html/
|
||||
@@ -12,6 +13,7 @@ ignore$
|
||||
\.bmp$
|
||||
\.dat$
|
||||
\.dll$
|
||||
\.filters$
|
||||
\.gcode$
|
||||
\.gif$
|
||||
\.gitignore$
|
||||
@@ -38,8 +40,8 @@ ignore$
|
||||
^src/modules/powerrename/UWPui/pch\.h$
|
||||
^src/modules/powerrename/UWPui/PowerRenameUWPUI\.vcxproj\.filters$
|
||||
^src/modules/previewpane/PreviewPaneUnitTests/HelperFiles/MarkdownWithHTMLImageTag\.txt$
|
||||
^src/modules/previewpane/UnitTests-MarkdownPreviewHandler/HelperFiles/MarkdownWithHTMLImageTag.txt$
|
||||
^tools/CleanUp_tool/CleanUp_tool\.vcxproj\.filters$
|
||||
^\.github/
|
||||
^\.github/actions/spell-check/
|
||||
^\.gitmodules$
|
||||
(?:^|/)WindowsSettings\.json$
|
||||
|
||||
230
.github/actions/spell-check/expect.txt
vendored
230
.github/actions/spell-check/expect.txt
vendored
File diff suppressed because it is too large
Load Diff
21
.github/actions/spell-check/patterns.txt
vendored
21
.github/actions/spell-check/patterns.txt
vendored
@@ -12,11 +12,24 @@ https?://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]*
|
||||
# msdn
|
||||
\b(?:download\.visualstudio|docs|msdn)\.microsoft\.com/[-_a-zA-Z0-9()=./]*
|
||||
|
||||
data:[a-zA-Z=;,/0-9+-]+
|
||||
0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP]
|
||||
(?:0[Xx]|U\+|#)[a-f0-9A-FGgRr]{2,}[Uu]?[Ll]{0,2}\b
|
||||
publicKeyToken=(['"]|)[0-9a-f]+\g{-1}
|
||||
\@sha256:[0-9a-f]{64}\b
|
||||
|
||||
# data urls
|
||||
(['"])data:.*?\g{-1}
|
||||
data:[-a-zA-Z=;:/0-9+]*,\S*
|
||||
|
||||
# uuid:
|
||||
[-<({"'>][0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}[<'"})>]
|
||||
L?(["']|[-<({>]|\b)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:\g{-1}|[<})>])
|
||||
|
||||
# c99 hex digits (not the full format, just one I've seen)
|
||||
0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP]
|
||||
|
||||
# wregex
|
||||
std::wregex\(L"[^"]*"\)
|
||||
|
||||
# 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
|
||||
|
||||
58
.github/workflows/spelling2.yml
vendored
58
.github/workflows/spelling2.yml
vendored
@@ -3,11 +3,23 @@ name: Spell checking
|
||||
on:
|
||||
pull_request_target:
|
||||
push:
|
||||
branches: ["**"]
|
||||
tags-ignore: ["**"]
|
||||
|
||||
jobs:
|
||||
spelling:
|
||||
name: Spell checking
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: read
|
||||
outputs:
|
||||
internal_state_directory: ${{ steps.spelling.outputs.internal_state_directory }}
|
||||
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:
|
||||
- name: checkout-merge
|
||||
if: "contains(github.event_name, 'pull_request')"
|
||||
@@ -15,8 +27,50 @@ jobs:
|
||||
with:
|
||||
ref: refs/pull/${{github.event.pull_request.number}}/merge
|
||||
- name: checkout
|
||||
if: "!contains(github.event_name, 'pull_request')"
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/checkout@v2
|
||||
- uses: check-spelling/check-spelling@v0.0.19
|
||||
- name: check-spelling
|
||||
id: spelling
|
||||
uses: check-spelling/check-spelling@v0.0.20-alpha3
|
||||
with:
|
||||
config: .github/actions/spell-check
|
||||
suppress_push_for_open_pull_request: 1
|
||||
post_comment: 0
|
||||
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
|
||||
runs-on: ubuntu-latest
|
||||
needs: spelling
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
if: always() && needs.spelling.result == 'failure' && needs.spelling.outputs.internal_state_directory
|
||||
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
|
||||
with:
|
||||
custom_task: comment
|
||||
internal_state_directory: /tmp/data
|
||||
|
||||
Reference in New Issue
Block a user