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

[PT Run] System plugin: Add IP and MAC #17023

Merged
merged 19 commits into from
Mar 21, 2022
Merged

Conversation

htcfreek
Copy link
Collaborator

@htcfreek htcfreek commented Mar 13, 2022

Summary of the Pull Request

What is this about:
This adds two new commands to show the IPs and MAC addresses of each network connection interface. To search for them on global queries the search term has to start with ip, mac or address.

image

Note: The new image has a not so good quality at the moment. I have asked @niels9001 for a better one. But I think the image should not block this PR from merging. The symbol is updated. (But not the screenshot.)

How does someone test / validate:
Test with local build.

Quality Checklist

Contributor License Agreement (CLA)

A CLA must be signed. If not, go over here and sign the CLA.

@github-actions
Copy link

github-actions bot commented Mar 13, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (8)

adresses
Dns
etwork
Forresult
IPv
Unicast
Wman
Wwanpp

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

... in a clone of the git@github.com:htcfreek/PowerToys.git repository
on the PT_System branch:

update_files() {
perl -e '
my $new_expect_file=".github/actions/spell-check/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/1066146587" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $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
If the flagged items do not appear to be text

If items relate to a ...

  • 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.

  • binary file.

    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).

@htcfreek htcfreek self-assigned this Mar 13, 2022
@htcfreek htcfreek added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface labels Mar 13, 2022
@htcfreek
Copy link
Collaborator Author

@niels9001
Can help me with creating better images for the new results? The have a bad quality.

@github-actions
Copy link

github-actions bot commented Mar 14, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (10)

Dns
etwork
Forresult
indicatin
IPv
Rerturns
sytsem
Unicast
Wman
Wwanpp

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

... in a clone of the git@github.com:htcfreek/PowerToys.git repository
on the PT_System branch:

update_files() {
perl -e '
my $new_expect_file=".github/actions/spell-check/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/1067108961" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $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
If the flagged items do not appear to be text

If items relate to a ...

  • 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.

  • binary file.

    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).

@niels9001
Copy link
Contributor

@niels9001 Can help me with creating better images for the new results? The have a bad quality.

Doesn't it make sense to just use the Settings plugin icon as this is part of that plugin? My worry is that it might become challenging to find relevant icons for all extensions at some point. (e.g. a network card icon for IP address might be confusing to users)

@htcfreek
Copy link
Collaborator Author

htcfreek commented Mar 15, 2022

@niels9001 Can help me with creating better images for the new results? The have a bad quality.

Doesn't it make sense to just use the Settings plugin icon as this is part of that plugin? My worry is that it might become challenging to find relevant icons for all extensions at some point. (e.g. a network card icon for IP address might be confusing to users)

It's system plugin angd not settings plugin. And we don't have a useful generic icon in this plugin.

For me the settings icon don't feels right. But we can use the "network adapter" icon for both. That would reduce the number of different icons.

I plan to add some network commands like ipconfig too. Which icon would you use for that? I thought on the network icon. But this can confuse as they are so similar and the cmd icon which would be a good one is used for an other plugin.

@github-actions
Copy link

github-actions bot commented Mar 15, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (13)
Dns
etwork
Forresult
Gbits
gbps
indicatin
IPv
Mbits
Rerturns
sytsem
Unicast
Wman
Wwanpp
To accept these unrecognized words as correct, run the following commands

... in a clone of the git@github.com:htcfreek/PowerToys.git repository
on the PT_System branch:

update_files() {
perl -e '
my $new_expect_file=".github/actions/spell-check/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/1068284330" > "$comment_json"
comment_body=$(mktemp)
jq -r ".body // empty" "$comment_json" > $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
If the flagged items do not appear to be text

If items relate to a ...

  • 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.

  • binary file.

    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).

@github-actions
Copy link

github-actions bot commented Mar 15, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (2)

etwork
gbps

Previously acknowledged words that are now absent Gbps Mbps
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:htcfreek/PowerToys.git repository
on the PT_System branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/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/spell-check/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/1068303982" > "$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
If the flagged items do not appear to be text

If items relate to a ...

  • 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.

  • binary file.

    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).

@github-actions
Copy link

github-actions bot commented Mar 15, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (1)

etwork

Previously acknowledged words that are now absent Mbps
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:htcfreek/PowerToys.git repository
on the PT_System branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/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/spell-check/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/1068315618" > "$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
If the flagged items do not appear to be text

If items relate to a ...

  • 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.

  • binary file.

    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).

@htcfreek
Copy link
Collaborator Author

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (1)

etwork

Previously acknowledged words that are now absent
Mbps
To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands
If the flagged items do not appear to be text

@jsoref
I can't find the incorrect word etwork in the files. Is there a problem with the image path $"Images\\network.{iconTheme}.png"? And the list of Previously acknowledged words that are now absent is incorrect.

@jsoref
Copy link
Contributor

jsoref commented Mar 15, 2022

@htcfreek:
etwork is indeed from \network, just add it here:
https://github.com/microsoft/PowerToys/blob/main/.github/actions/spell-check/patterns.txt#L48

I'm sorry. At some point, I'm going to probably move the magic that handles \n/\r/\t into https://github.com/check-spelling/spell-check-this/blob/main/.github/actions/spelling/patterns.txt and out of the core defaults. I think it's right about 95% of the time in general, and maybe 50-75% of the time when dealing w/ Windows systems, but that isn't really good enough.

Not sure about the other bit, can you clarify?

@htcfreek
Copy link
Collaborator Author

@jsoref
The comment says that Mbps is obsolete in expect.txt. But it exists in the code.

@github-actions
Copy link

github-actions bot commented Mar 16, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (1)

etwork

Previously acknowledged words that are now absent Mbps
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:htcfreek/PowerToys.git repository
on the PT_System branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/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/spell-check/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/1068918376" > "$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
If the flagged items do not appear to be text

If items relate to a ...

  • 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.

  • binary file.

    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).

@htcfreek
Copy link
Collaborator Author

@niels9001
Regarding the icon some things have changed. We now use the same icon for mac and ip. I only need a good icon version for the network adapter symbol.

@jsoref
Copy link
Contributor

jsoref commented Mar 16, 2022

@htcfreek: So, the base dictionary appears to have:

BPS
bps
BPSS
KBPS
kbps
MBPS
mbps

(I have no idea what BPSS is.)

The dictionary's mbps entry is covering your Mbps. You can verify by applying these changes:

diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt
index 0279f0ca3..81714abde 100644
--- a/.github/actions/spell-check/expect.txt
+++ b/.github/actions/spell-check/expect.txt
@@ -1185,3 +1185,2 @@ maxversiontested
 Mbits
-Mbps
 MBs
@@ -2391,2 +2390,2 @@ Zoneszonabletester
 Zonev
-zzz
\ No newline at end of file
+zzz
diff --git a/.github/actions/spell-check/patterns.txt b/.github/actions/spell-check/patterns.txt
index 66274dccd..a9bc2dca1 100644
--- a/.github/actions/spell-check/patterns.txt
+++ b/.github/actions/spell-check/patterns.txt
@@ -51,2 +51,3 @@ TestCase\("[^"]+"
 \\netstandard
+\\network
 \\notifications
diff --git a/.github/actions/spell-check/reject.txt b/.github/actions/spell-check/reject.txt
new file mode 100644
index 000000000..9e4575656
--- /dev/null
+++ b/.github/actions/spell-check/reject.txt
@@ -0,0 +1 @@
+mbps

You want the patterns change and expect changes, but obviously for this PR you wouldn't want to add the reject file, it's just for demonstration purposes.

The notable thing about the dictionary is that it doesn't have gbps/GBPS, the dictionary is "old", so that was clearly too far into its future for it to be a concept that was included.

@htcfreek
Copy link
Collaborator Author

htcfreek commented Mar 16, 2022

@htcfreek: So, the base dictionary appears to have:

BPS
bps
BPSS
KBPS
kbps
MBPS
mbps

(I have no idea what BPSS is.)

The dictionary's mbps entry is covering your Mbps. You can verify by applying these changes:

diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt
index 0279f0ca3..81714abde 100644
--- a/.github/actions/spell-check/expect.txt
+++ b/.github/actions/spell-check/expect.txt
@@ -1185,3 +1185,2 @@ maxversiontested
 Mbits
-Mbps
 MBs
@@ -2391,2 +2390,2 @@ Zoneszonabletester
 Zonev
-zzz
\ No newline at end of file
+zzz
diff --git a/.github/actions/spell-check/patterns.txt b/.github/actions/spell-check/patterns.txt
index 66274dccd..a9bc2dca1 100644
--- a/.github/actions/spell-check/patterns.txt
+++ b/.github/actions/spell-check/patterns.txt
@@ -51,2 +51,3 @@ TestCase\("[^"]+"
 \\netstandard
+\\network
 \\notifications
diff --git a/.github/actions/spell-check/reject.txt b/.github/actions/spell-check/reject.txt
new file mode 100644
index 000000000..9e4575656
--- /dev/null
+++ b/.github/actions/spell-check/reject.txt
@@ -0,0 +1 @@
+mbps

You want the patterns change and expect changes, but obviously for this PR you wouldn't want to add the reject file, it's just for demonstration purposes.

The notable thing about the dictionary is that it doesn't have gbps/GBPS, the dictionary is "old", so that was clearly too far into its future for it to be a concept that was included.

I added Mbps because the phrase Gbps was required in expect.txt. I will remove Mbps.

@jsoref
Copy link
Contributor

jsoref commented Mar 16, 2022

Yeah, I know it's confusing. Dictionaries can evolve, but in general, any dictionary will be a snapshot in time. And in order to not surprise people, I haven't evolved the dictionary check-spelling uses.

I do think I'll probably at some point make at least one revision to the dictionary. Including GBPS/gbps and maybe even TBPS/tbps seems like something I might want to do -- I'm not entirely certain I'd want to do that, as tbps could easily be a typo for tbsp. Making the call about what to add into a dictionary is actually hard. It's a lot easier

What would happen is that there'd be a newer version of the dictionary available, and people could opt-in to use it. And then much further into the future, I might change the default, so at an upgrade, people could get that newer dictionary, but opt to use the older one.


I think my general advice is to not try to predict what the spell checker will suggest putting into expect.txt. If you're concerned that something should be a word regardless of what happens, you could add a line for it into a .txt file in: https://github.com/microsoft/PowerToys/tree/main/.github/actions/spell-check/allow

But do note that the spell checker only thinks about words that match its sense of words, so nVidia here will be ignored:

@jsoref
Copy link
Contributor

jsoref commented Mar 18, 2022

There's a space between the literal IP and the literal v4/v6:
image

https://en.wikipedia.org/wiki/IPv4
https://en.wikipedia.org/wiki/IPv6

Copy link
Contributor

@jsoref jsoref left a comment

Choose a reason for hiding this comment

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

It'd be something like this,

plus adding this to patterns.txt (from https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns)

# version suffix <word>v#
[Vv]\d+(?:\b|(?=[a-zA-Z_]))

@htcfreek
Copy link
Collaborator Author

@jaimecbernardo
Wen do we close v0.57.0 for new features?

@github-actions
Copy link

github-actions bot commented Mar 19, 2022

@check-spelling-bot Report

🔴 Please review

See the files view or the action log for details.

Unrecognized words (1)

ipv

Previously acknowledged words that are now absent David IPv Morton
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:htcfreek/PowerToys.git repository
on the PT_System branch:

update_files() {
perl -e '
my @expect_files=qw('".github/actions/spell-check/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/spell-check/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/1072994238" > "$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
If the flagged items do not appear to be text

If items relate to a ...

  • 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.

  • binary file.

    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).

@htcfreek
Copy link
Collaborator Author

htcfreek commented Mar 19, 2022

@jsoref
I have updates the naming and added the pattern.

@stefansjfw
I have changed scoring to give the results a lower priority. The user can disable this behavior in settings now. The Description of this setting can be moved into a secondary text when #17108 is merged.

@niels9001
Is the image going to be ready this weekend?

@niels9001
Copy link
Contributor

networkAdapter light
networkAdapter dark

@htcfreek Here you go :)

Copy link
Contributor

@jsoref jsoref left a comment

Choose a reason for hiding this comment

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

@htcfreek: looks good,

fwiw, you no longer need IPv in expect (and can also apparently remove settingsv which probably also was matched by the pattern):
https://github.com/microsoft/PowerToys/runs/5612548869?check_suite_focus=true#step:4:70
(and you can remove the other two items as well, or wait for someone else to...)

@htcfreek
Copy link
Collaborator Author

htcfreek commented Mar 20, 2022

@htcfreek: looks good,

fwiw, you no longer need IPv in expect (and can also apparently remove settingsv which probably also was matched by the pattern):
https://github.com/microsoft/PowerToys/runs/5612548869?check_suite_focus=true#step:4:70
(and you can remove the other two items as well, or wait for someone else to...)

I think the patterns are bad if they mark things as okay that don't have anything to do with IPv4/IPv6.

And btw, David Morton is the name of someone and not a version number.

@jsoref
Copy link
Contributor

jsoref commented Mar 20, 2022

Nah, the parsing is right settings+v# and settings is a word in the dictionary.

My guess is that both David and Morton are in the base dictionary and thus don't need to be in expect. (I'd have to check.)

@htcfreek
Copy link
Collaborator Author

htcfreek commented Mar 20, 2022

Nah, the parsing is right settings+v# and settings is a word in the dictionary.

My guess is that both David and Morton are in the base dictionary and thus don't need to be in expect. (I'd have to check.)

Than you have updated base dict. Please let use move this dictionary cleanup into an other PR.

@jaimecbernardo
Copy link
Collaborator

@jaimecbernardo Wen do we close v0.57.0 for new features?

No set date yet, but most likely it should be mid-end of this week.

@htcfreek
Copy link
Collaborator Author

@jaimecbernardo Wen do we close v0.57.0 for new features?

No set date yet, but most likely it should be mid-end of this week.

Currently I am waiting for a new approval from @stefansjfw and then this can go in.

Copy link
Collaborator

@stefansjfw stefansjfw left a comment

Choose a reason for hiding this comment

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

Looks good. Although, I'm not completely sure about "Reduce score" settings. But I guess we can adapt in the future if needed - ip and mac results are still on top of other plugins which could make some users unhappy. But, as I said, let's see..

@htcfreek
Copy link
Collaborator Author

Looks good. Although, I'm not completely sure about "Reduce score" settings. But I guess we can adapt in the future if needed - ip and mac results are still on top of other plugins which could make some users unhappy. But, as I said, let's see..

What do you searched? I tried my best. But this is a fuzzyMatch scoring thing.

What is you worry about the setting?

@stefansjfw
Copy link
Collaborator

Looks good. Although, I'm not completely sure about "Reduce score" settings. But I guess we can adapt in the future if needed - ip and mac results are still on top of other plugins which could make some users unhappy. But, as I said, let's see..

What do you searched? I tried my best. But this is a fuzzyMatch scoring thing.

What is you worry about the setting?

That we'll end up with more "Reduce score" settings, and then scoring won't make sense :)
It feels to me that if user wants to get Ip or mac, it should be strict clear search as the intention is clear.
Something like adding prefix - "network ip" or "net ip".

@htcfreek
Copy link
Collaborator Author

Looks good. Although, I'm not completely sure about "Reduce score" settings. But I guess we can adapt in the future if needed - ip and mac results are still on top of other plugins which could make some users unhappy. But, as I said, let's see..

What do you searched? I tried my best. But this is a fuzzyMatch scoring thing.

What is you worry about the setting?

That we'll end up with more "Reduce score" settings, and then scoring won't make sense :)
It feels to me that if user wants to get Ip or mac, it should be strict clear search as the intention is clear.
Something like adding prefix - "network ip" or "net ip".

What about Network: IPv... and Network adapter: MAC...? This might help.

@stefansjfw
Copy link
Collaborator

I don't have strong feeling about this. It's more of a suggestion. @crutkas @jaimecbernardo WDYT?

@htcfreek
Copy link
Collaborator Author

@jaimecbernardo
It's your turn to decide if this can go in or if we should adjust again.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

Just gave it a try. It feels OK to me. Thanks for the contribution.

@jaimecbernardo
Copy link
Collaborator

It's ok to return these results in a good position from just "ip" or "mac". I like that the setting to reduce is on by default as well. Let's see how people feel about these.

@jaimecbernardo jaimecbernardo merged commit 4c067bb into microsoft:main Mar 21, 2022
@htcfreek htcfreek deleted the PT_System branch March 21, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Review This Pull Request awaits the review of a maintainer. Product-PowerToys Run Improved app launch PT Run (Win+R) Window Run-Plugin Things that relate with PowerToys Run's plugin interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants