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

OSOE-470: Remove false entries (actual typos) from spell checking allow lists in Lombiq.GitHub.Actions #111

Merged
merged 61 commits into from
Dec 8, 2022

Conversation

porgabi
Copy link
Member

@porgabi porgabi commented Nov 22, 2022

Copy link
Member

@BenedekFarkas BenedekFarkas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check every entry that doesn't seem to be a proper word.

.github/actions/spelling/patterns.txt Show resolved Hide resolved
.github/actions/spelling/patterns.txt Outdated Show resolved Hide resolved
.github/actions/spelling/patterns.txt Outdated Show resolved Hide resolved
.github/actions/spelling/patterns.txt Outdated Show resolved Hide resolved
.github/actions/spelling/patterns.txt Outdated Show resolved Hide resolved
.github/actions/spelling/expect.txt Show resolved Hide resolved
.github/actions/spelling/allow.txt Show resolved Hide resolved
@0liver
Copy link
Contributor

0liver commented Dec 5, 2022

Btw, here's how to use those dictionaries from GHA:

jobs:
  spelling:
    name: Spelling
    uses: Lombiq/GitHub-Actions/.github/workflows/spelling.yml@issue/CARE-275
    secrets:
      CHECKOUT_TOKEN: ${{ secrets.LOMBIQBOT_GITHUB_PERSONAL_ACCESS_TOKEN }}
    with:
      dictionary-source-prefixes: '{
        "cspell": "https://raw.githubusercontent.com/check-spelling/cspell-dicts/v20220816/dictionaries/",
        "gha": "https://raw.githubusercontent.com/Lombiq/GitHub-Actions/dev/.github/actions/spelling/"
      }'
      extra-dictionaries:
        cspell:filetypes/filetypes.txt
        cspell:django/django.txt
        cspell:aws/aws.txt
        cspell:html/html.txt
        cspell:css/css.txt
        cspell:csharp/csharp.txt
        cspell:rust/rust.txt
        cspell:npm/npm.txt
        cspell:dotnet/dotnet.txt
        cspell:scala/scala.txt
        gha:allow.txt
        gha:excludes.txt
        gha:expect.txt
        gha:patterns.txt

@0liver
Copy link
Contributor

0liver commented Dec 5, 2022

Looking forward to you merging this to avoid conflicts with my project issue.

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Dec 8, 2022

@check-spelling-bot Report

🔴 Please review

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

Unrecognized words (1)

CLOUDSMITH

Previously acknowledged words that are now absent abcdef abcdefghijklmnopqrstuvwxyz amet Argb bak baz Bcc blog btn buble CDNs certs chainable chartjs chmod chown Chro chromedriver cjs Cloudflare Cms cref crlf csharp ctor ctx cwd dba DBs dddd EACCES ecma editorconfig emails Embedd enableextensions esm EULA eur falsey favicon fff ffff Fhd fixme GDPR Graphi hsva https Hvga icbin idx iife iis ipsum IShortcode itemprop json jsoneditor jsoneditoronline KUhd labelledby linebreak linkedin linting linux localhost lockfile lookbehind markdownlint mcr mde mixin mkdir mogwais Moq msbuild mscorlib msedgedriver mso MVVM myapp navbar Nhd NLog Noda nologo NONINFRINGEMENT NPM npx NTFS NVARCHAR omnisharp onspecial onwarn orchardcore osoce parallelizable pickr PII plusplus pnpm popstate postclean Postgre pragma prebuild preheader publishsettings pwd pwsh Qhd Qvga Qwxga readdir Regexes Rekt RHEL RSPEC sdk setlocal SFCs shortcode sln sme Smo sourced sourcemaps sql sqlcmd sudoing SUSE Svga Sxga testid thetheme todo tundora Tzdb uri urijs userspace utf Uwqhd Vga vuejs vuelidate wcag webapp wpf Wsxga Wuxga wwwroot Wxga Wysiwyg XDG Xga xsessionrc XSRF xxl yaml Yarp yml yyyy
To accept ✔️ these unrecognized words as correct and remove the previously acknowledged and now absent words, run the following commands

... in a clone of the [email protected]:Lombiq/GitHub-Actions.git repository
on the dev branch (ℹ️ how do I use this?):

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/expect.txt"');
@ARGV=@expect_files;
my @stale=qw('"$patch_remove"');
my $re=join "|", @stale;
my $suffix=".".time();
my $previous="";
sub maybe_unlink { unlink($_[0]) if $_[0]; }
while (<>) {
if ($ARGV ne $old_argv) { maybe_unlink($previous); $previous="$ARGV$suffix"; rename($ARGV, $previous); open(ARGV_OUT, ">$ARGV"); select(ARGV_OUT); $old_argv = $ARGV; }
next if /^(?:$re)(?:(?:\r|\n)*$| .*)/; print;
}; maybe_unlink($previous);'
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/Lombiq/GitHub-Actions/issues/comments/1343051559" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" | tr -d "\\r" > $comment_body
rm $comment_json

patch_remove=$(perl -ne 'next unless s{^</summary>(.*)</details>$}{$1}; print' < "$comment_body")

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 (168) from .github/actions/spelling/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:software-terms/src/software-terms.txt 1237 3
cspell:cpp/src/people.txt 23 1
cspell:cpp/src/cpp.txt 30216 1

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

      with:
        extra_dictionaries:
          cspell:software-terms/src/software-terms.txt
          cspell:cpp/src/people.txt
          cspell:cpp/src/cpp.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
ℹ️ non-alpha-in-dictionary 1

See ℹ️ Event descriptions for more information.

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.

5 participants