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

Use check-spelling/[email protected] #2467

Merged
merged 9 commits into from
Aug 23, 2022
Merged

Conversation

jsoref
Copy link
Contributor

@jsoref jsoref commented Aug 22, 2022


Upgrades to v0.0.20

The upgrade will automatically collapse the most recent PR comment when a PR is updated.

Refreshes the workflow based on
https://github.com/check-spelling/spell-check-this/blob/744c66e2140fd8acaf5388efd0db3727d010d6e9/.github/workflows/spelling.yml

The refresh implements reduced privilege for the workflow, changes the minimum word length from 2 to 3 (the default), and adds line_forbidden.patterns (including duplicate word detection).

If the Gitlab -> GitLab changes are problematic, the commit can be dropped and the entry removed from .github/actions/spelling/line_forbidden.patterns.

Microsoft Reviewers: Open in CodeFlow

jsoref added 8 commits August 22, 2022 15:10
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
Signed-off-by: Josh Soref <[email protected]>
@jsoref jsoref requested a review from a team as a code owner August 22, 2022 19:39
@github-actions
Copy link

github-actions bot commented Aug 22, 2022

@check-spelling-bot Report

Unrecognized words, please review:

  • ci
  • dw
  • fd
  • jp
  • KF
  • Kp
  • lw
  • lz
  • mx
  • NX
  • pb
  • px
  • pz
  • qb
  • ul
  • vy
  • wn
  • zy
To accept these unrecognized words as correct, run the following commands

... in a clone of the [email protected]:jsoref/winget-cli.git repository
on the spell-check branch:

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 \
  --header "Content-Type: application/json" \
  "https://api.github.com/repos/microsoft/winget-cli/issues/comments/1222840497" > "$comment_json"
comment_body=$(mktemp)
jq -r .body < "$comment_json" > $comment_body
rm $comment_json

patch_add=$(perl -e '$/=undef;
$_=<>;
s{<details>.*}{}s;
s{^#.*}{};
s{\n##.*}{};
s{(?:^|\n)\s*\*}{}g;
s{\s+}{ }g;
print' < "$comment_body")
  
update_files
rm $comment_body
git add -u
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
Copy link
Contributor Author

jsoref commented Aug 22, 2022

(Those items can go away after this merges.)

Copy link
Contributor

@vedantmgoyal9 vedantmgoyal9 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 to me!

@ryfu-msft ryfu-msft merged commit ba0b9fc into microsoft:master Aug 23, 2022
ryfu-msft added a commit that referenced this pull request Aug 23, 2022
@jsoref
Copy link
Contributor Author

jsoref commented Aug 23, 2022

@ryfu-msft: did something go wrong?

@jsoref jsoref deleted the spell-check branch August 23, 2022 19:01
@ryfu-msft
Copy link
Contributor

ryfu-msft commented Aug 23, 2022

@jsoref I meant to click view details, and accidentally clicked revert and it created that commit...

@Trenly
Copy link
Contributor

Trenly commented Sep 6, 2022

@jsoref - Does winget-pkgs need to be updated? It seems you have some great tools to help clean up the dictionary files

@jsoref
Copy link
Contributor Author

jsoref commented Sep 6, 2022

@Trenly: yes, it absolutely should be, I'm not sure why I didn't find that when I was looking.

@Trenly
Copy link
Contributor

Trenly commented Sep 6, 2022

@Trenly: yes, it absolutely should be, I'm not sure why I didn't find that when I was looking.

Would you be able to open the PR for it? I'm not confident that I have the know-how on the implementation details

@jsoref
Copy link
Contributor Author

jsoref commented Sep 6, 2022

Yeah, working on it. Currently tripping on the GitHub outage.

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