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

Remove all vestiges of the old CDPx pipeline and old loc data #15242

Merged
merged 4 commits into from
Jan 3, 2022

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented Jan 3, 2022

This pull request removes build steps and localization files that we no longer need.

@github-actions
Copy link

github-actions bot commented Jan 3, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

Pdb
Toolset

Previously acknowledged words that are now absent appcontainer azurecr binskim buildcommand buildtools cdpxwin CPPARM CPPx defaultcommand dupenv DUSTIN errorlevel estdir etcore Firefox Gamebar Grayscale LASTEXITCODE LEQ linkid Minimizeallwindows mkdir moderncop namings neq nocache npm pdb policheck popd pushd robocopy SHAREIMAGELISTS spamming spdth Switchbetweenvirtualdesktops SYSTEMASTERISK toolset umd vse vsix WDK wdksetup wdkvsix We'd webclient webpack WINMSAPP
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]:microsoft/PowerToys.git repository
on the dev/duhowett/no-cdpx branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/whitelist.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/microsoft/PowerToys/issues/comments/1004409201" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $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

@DHowett DHowett marked this pull request as ready for review January 3, 2022 23:05
@github-actions
Copy link

github-actions bot commented Jan 3, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

Pdb
Toolset

Previously acknowledged words that are now absent appcontainer azurecr binskim buildcommand buildtools cdpxwin CPPARM CPPx defaultcommand dupenv DUSTIN errorlevel estdir etcore Firefox Gamebar Grayscale LASTEXITCODE LEQ linkid Minimizeallwindows mkdir moderncop namings neq nocache npm pdb policheck popd pushd robocopy SHAREIMAGELISTS spamming spdth Switchbetweenvirtualdesktops SYSTEMASTERISK toolset umd vse vsix WDK wdksetup wdkvsix We'd webclient webpack WINMSAPP
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]:microsoft/PowerToys.git repository
on the dev/duhowett/no-cdpx branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spelling/whitelist.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/microsoft/PowerToys/issues/comments/1004415787" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $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

@DHowett
Copy link
Member Author

DHowett commented Jan 3, 2022

I have no idea why spelling is blowing up at me, all I did was remove files and main is clean (???)

@franky920920
Copy link
Contributor

I have no idea why spelling is blowing up at me, all I did was remove files and main is clean (???)

cc: @jsoref FYI

Copy link
Member

@crutkas crutkas left a comment

Choose a reason for hiding this comment

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

i'm jelly of the amount of deleted lines here

@DHowett DHowett changed the title Remove all vestiges of the old CDPx pipeline and old localization data Remove all vestiges of the old CDPx pipeline and old loc data Jan 3, 2022
@DHowett DHowett merged commit 4484727 into main Jan 3, 2022
@DHowett DHowett deleted the dev/duhowett/no-cdpx branch January 3, 2022 23:51
@jsoref
Copy link
Contributor

jsoref commented Jan 4, 2022

@DHowett, check-spelling currently prioritizes cases (pdb < Pdb < PDB).

Previously the code base had: Pdb, pdb, Toolset, toolset.

The removal here resulted in this:

Previously acknowledged words that are now absent
... pdb ... toolset ...

That left only these case variations:

Pdb
Toolset

The idea (which I'm seriously reconsidering) is that you could have a repository that allows Microsoft but doesn't allow microsoft. So, if someone adds the lowercase variant, they should be asked to approve that separately, but if they allow microsoft, then they're probably implicitly accepting Microsoft, if only for when it's used in the beginning of a sentence.

Anyway, when you remove the last instance of the lowercase flavor, it wants to return to the stricter form.

I'm very close to just having the expect file manage each word form independently.

@franky920920 franky920920 mentioned this pull request Jan 4, 2022
10 tasks
@DHowett
Copy link
Member Author

DHowett commented Jan 4, 2022

AH, that totally makes sense. Thanks for the explanation!

I agree about having the expect file manage each word form independently. The "microsoft" vs. "Microsoft" example is apt 😄

DHowett pushed a commit that referenced this pull request Jan 4, 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.

4 participants