Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Refresh check-spelling workflow #865

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Sep 21, 2022

I hereby granted the copyright of the changes in this pull request
to the authors of this openresty project.

@github-actions
Copy link

github-actions bot commented Sep 21, 2022

@check-spelling-bot Report

🔴 Please review

See the 📂 files view or the 📜action log for details.

Unrecognized words (8)

csv
dll
exe
flv
html
json
lua
perl

To accept ✔️ these unrecognized words as correct, run the following commands

... in a clone of the [email protected]:check-spelling/openresty.git repository
on the spell-check-with-spelling branch (ℹ️ how do I use this?):

update_files() {
perl -e '
my $new_expect_file=".github/actions/spelling/expect.txt";
use File::Path qw(make_path);
use File::Basename qw(dirname);
make_path (dirname($new_expect_file));
open FILE, q{<}, $new_expect_file; chomp(my @words = <FILE>); close FILE;
my @add=qw('"$patch_add"');
my %items; @items{@words} = @words x (1); @items{@add} = @add x (1);
@words = sort {lc($a)."-".$a cmp lc($b)."-".$b} keys %items;
open FILE, q{>}, $new_expect_file; for my $word (@words) { print FILE "$word\n" if $word =~ /\w/; };
close FILE;
system("git", "add", $new_expect_file);
'
}

comment_json=$(mktemp)
curl -L -s -S \
-H "Content-Type: application/json" \
"https://api.github.com/repos/openresty/openresty/issues/comments/1253442388" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" | tr -d "\\r" > $comment_body
rm $comment_json

patch_add=$(perl -e '$/=undef; $_=<>; if (m{Unrecognized words[^<]*</summary>\n*```\n*([^<]*)```\n*</details>$}m) { print "$1" } elsif (m{Unrecognized words[^<]*\n\n((?:\w.*\n)+)\n}m) { print "$1" };' < "$comment_body")

update_files
rm $comment_body
git add -u
Available dictionaries could cover words not in the dictionary

This includes both expected items (43) from .github/actions/spelling/expect.txt and unrecognized words (8)

cspell:golang/go.txt (7745) covers 8 of them
cspell:filetypes/filetypes.txt (337) covers 8 of them
cspell:aws/aws.txt (1485) covers 6 of them
cspell:django/django.txt (2342) covers 5 of them
cspell:npm/npm.txt (671) covers 2 of them

Consider adding them using (in .github/workflows/spelling.yml):

      with:
        extra_dictionaries:
          cspell:golang/go.txt
          cspell:filetypes/filetypes.txt
          cspell:aws/aws.txt
          cspell:django/django.txt
          cspell:npm/npm.txt

To stop checking additional dictionaries, add:

      with:
        check_extra_dictionaries: ''
Warnings (1)

See the 📂 files view or the 📜action log for details.

ℹ️ Warnings Count
ℹ️ limited-references 1

See ℹ️ Event descriptions for more information.

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 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 (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

@jsoref jsoref changed the title Refresh check-spelling workflow chore: Refresh check-spelling workflow Sep 21, 2022
@jsoref jsoref changed the title chore: Refresh check-spelling workflow test: Refresh check-spelling workflow Sep 21, 2022
@jsoref
Copy link
Contributor Author

jsoref commented Sep 21, 2022

Fwiw, this is based on check-spelling/spell-check-this@d960851

I didn't mean to create this PR from this repository, I was trying to create a PR to my own repo to make sure the PR would look proper, so, it came off prematurely...

The unrecognized words listed above will be prunable after this PR merges.

With this workflow refresh, comments will be collapsed as newer commits are pushed to a PR branch.

@zhuizhuhaomeng zhuizhuhaomeng changed the title test: Refresh check-spelling workflow tests: Refresh check-spelling workflow Sep 23, 2022
@zhuizhuhaomeng zhuizhuhaomeng merged commit e7e21f9 into openresty:master Sep 23, 2022
@jsoref jsoref deleted the spell-check-with-spelling branch September 23, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants