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

OCC-114: Introduce spell checking via GHA and fix any spelling mistakes. #234

Merged
merged 10 commits into from Dec 14, 2022

Conversation

DemeSzabolcs
Copy link
Contributor

@DemeSzabolcs DemeSzabolcs commented Dec 4, 2022

OCC-114

Fixes #232

@DemeSzabolcs DemeSzabolcs marked this pull request as ready for review December 4, 2022 16:25
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Dec 11, 2022

@check-spelling-bot Report

🔴 Please review

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

Unrecognized words (1)

Wcag

Previously acknowledged words that are now absent abcdef abcdefghijklmnopqrstuvwxyz Aig Airi amet Argb bak Bcc BJRQ ble blog BOHq Bubl buble CDNs certs chainable chartjs chmod chown Chro chromedriver cjs Cloudflare Cmi crlf csharp ctor ctx cwd cwj dba DBs Dci dddd dfdc EACCES ecma editorconfig Efq Egyw emails Embedd enableextensions Erau esm ETbp EULA eur falsey favicon fff ffff Fhd fixme flj FNGAQ GDPR Graphi GVm HEUZ HKx HQXp HRSF Hsl hsva https Hvga Hxn icbin idx iife iis ipsum IShortcode itemprop JIRA JMES Jmgx json jsoneditor jsoneditoronline KQl KUhd KWJv labelledby length'l linebreak linkedin linq linting linux localhost lockfile lookbehind markdownlint mcr mde mixin mkdir mogwais Moq MPRr msbuild mscorlib msedgedriver mso mvc mvdtskz MVVM myapp navbar Nbyf ndproj Nepw Nhd NHx Noda nologo NPM npx NTFS nuget NVARCHAR omnisharp onspecial onwarn Panem parallelizable pickr PII plusplus pnpm popstate postclean Postgre pragma prebuild preheader publishsettings pwd PWn pwsh Qhd Qvga Qwxga QXSh readdir Regexes Reks Rekt RHEL Rkao Rrg RSPEC Sckc SDl search'f SEH setlocal SFCs shortcode SHx SLc sln sme Smo sourced sourcemaps sql sqlcmd sudoing SUSE Svga Sxga testid Tful Tgu thetheme todo tundora Tzdb ubuntu Uevh Uocgz UPPf uri urijs userspace utf Uwqhd UYdg Vga vuejs vuelidate Vzl wcag webapp wiki Wjf wpf Wqhd Wsxga Wuxga wwwroot Wxga XCE XDG Xga Xhzsg Xrka xsessionrc XSRF xxl yaml Yarp Yeuw yml YOUw 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 git@github.com:OrchardCMS/OrchardCore.Commerce.git repository
on the main 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/OrchardCMS/OrchardCore.Commerce/issues/comments/1345615537" > "$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 (253) from .github/actions/spelling/expect.txt and unrecognized words (1)

Dictionary Entries Covers
cspell:cpp/src/cpp.txt 30216 4
cspell:typescript/typescript.txt 1211 1
cspell:python/src/python/python-lib.txt 3873 1
cspell:node/node.txt 1768 1
cspell:cpp/src/stdlib-cpp.txt 252 1

Consider adding them using (in .github/workflows/build-and-test.yml):

      with:
        extra_dictionaries:
          cspell:cpp/src/cpp.txt
          cspell:typescript/typescript.txt
          cspell:python/src/python/python-lib.txt
          cspell:node/node.txt
          cspell:cpp/src/stdlib-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.

@sarahelsaig sarahelsaig merged commit 23e7f39 into main Dec 14, 2022
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.

Introduce spell checking via GHA and fix any spelling mistakes. (OCC-114)
2 participants