Skip to content

Commit

Permalink
Add check-spelling
Browse files Browse the repository at this point in the history
  • Loading branch information
jsoref committed Dec 31, 2021
1 parent c407b2d commit 032bfa6
Show file tree
Hide file tree
Showing 8 changed files with 1,553 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/actions/spelling/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# check-spelling/check-spelling configuration

File | Purpose | Format | Info
-|-|-|-
[dictionary.txt](dictionary.txt) | Replacement dictionary (creating this file will override the default dictionary) | one word per line | [dictionary](https://github.com/check-spelling/check-spelling/wiki/Configuration#dictionary)
[allow.txt](allow.txt) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow)
[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject)
[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes)
[only.txt](only.txt) | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only)
[patterns.txt](patterns.txt) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns)
[expect.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect)
[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice)

Note: you can replace any of these files with a directory by the same name (minus the suffix)
and then include multiple files inside that directory (with that suffix) to merge multiple files together.
25 changes: 25 additions & 0 deletions .github/actions/spelling/advice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
<details><summary>If the flagged items do not appear to be text</summary>

If items relate to a ...
* well-formed pattern.

If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it,
try adding it to the `patterns.txt` file.

Patterns are Perl 5 Regular Expressions - you can [test](
https://www.regexplanet.com/advanced/perl/) 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](
https://www.regexplanet.com/advanced/perl/) 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](
../tree/HEAD/README.md) (on whichever branch you're using).

</details>
Empty file.
108 changes: 108 additions & 0 deletions .github/actions/spelling/excludes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
(?:^|/)(?i)COPYRIGHT
(?:^|/)(?i)LICEN[CS]E
(?:^|/)go\.sum$
(?:^|/)package(?:-lock|)\.json$
(?:^|/)vendor/
ignore$
\.ai$
\.avi$
\.bmp$
\.bz2$
\.crt$
\.DS_Store$
\.eot$
\.gif$
\.gitattributes$
\.graffle$
\.gz$
\.icns$
\.ico$
\.jar$
\.jpe?g$
\.key$
\.lock$
\.map$
\.min\..
\.mod$
\.mp[34]$
\.ocf$
\.otf$
\.pdf$
\.pem$
\.png$
\.psd$
\.svg$
\.ttf$
\.wav$
\.woff2?$
\.zip$
^\.github/
^\Qconfig/configmap/kustomization.yaml\E$
^\Qconfig/overlays/test/runtimes/kustomization.yaml\E$
^\Qconfig/runtimes/kustomization.yaml\E$
^\Qdocs/diagrams/dataplane.drawio\E$
^\Qdocs/diagrams/kfs_architect.drawio\E$
^\Qdocs/samples/drift-detection/alibi-detect/cifar10/cifar10_drift.ipynb\E$
^\Qdocs/samples/explanation/aif/germancredit/server/requirements.txt\E$
^\Qdocs/samples/explanation/aix/mnist/query_explain.ipynb\E$
^\Qdocs/samples/explanation/aix/mnist/requirements.txt\E$
^\Qdocs/samples/explanation/aix/mnist/rfserver/rfmodel.pickle\E$
^\Qdocs/samples/explanation/art/mnist/sklearnserver/sklearnserver/example_model/model.pkl\E$
^\Qdocs/samples/explanation/art/mnist/sklearnserver/sklearnserver/example_models/joblib/model/model.joblib\E$
^\Qdocs/samples/explanation/art/mnist/sklearnserver/sklearnserver/example_models/pickle/model/model.pickle\E$
^\Qdocs/samples/explanation/art/mnist/sklearnserver/sklearnserver/example_models/pkl/model.pkl\E$
^\Qdocs/samples/explanation/art/mnist/sklearnserver/sklearnserver/example_models/pkl/model/model.pkl\E$
^\Qdocs/samples/outlier-detection/alibi-detect/cifar10/cifar10_outlier.ipynb\E$
^\Qdocs/samples/v1beta1/custom/custom_model/input.json\E$
^\Qdocs/samples/v1beta1/onnx/mosaic-onnx.ipynb\E$
^\Qdocs/samples/v1beta1/onnx/requirements.txt\E$
^\Qdocs/samples/v1beta1/paddle/jay.json\E$
^\Qdocs/samples/v1beta1/paddle/junco_snowbird.json\E$
^\Qdocs/samples/v1beta1/rollout/input.json\E$
^\Qdocs/samples/v1beta1/sklearn/v2/model.joblib\E$
^\Qdocs/samples/v1beta1/sklearn/v2/requirements.txt\E$
^\Qdocs/samples/v1beta1/tensorflow/input.json\E$
^\Qdocs/samples/v1beta1/torchserve/model-archiver/model-store/densenet_161/index_to_name.json\E$
^\Qdocs/samples/v1beta1/torchserve/v1/imgconv/input.json\E$
^\Qdocs/samples/v1beta1/torchserve/v1/mnist.json\E$
^\Qdocs/samples/v1beta1/transformer/torchserve_image_transformer/input.json\E$
^\Qdocs/samples/v1beta1/triton/torchscript/image.json\E$
^\Qdocs/samples/v1beta1/xgboost/model.bst\E$
^\Qdocs/samples/v1beta1/xgboost/requirements.txt\E$
^\QOWNERS\E$
^\Qpython/alibiexplainer/tests/persian_cat.json\E$
^\Qpython/custom_model/requirements.txt\E$
^\Qpython/custom_transformer/requirements.txt\E$
^\Qpython/kserve/OWNERS\E$
^\Qpython/kserve/requirements.txt\E$
^\Qpython/paddleserver/paddleserver/example_models/pyramidbox_lite/params.pdiparams\E$
^\Qpython/pytorchserver/pytorchserver/example_model/model/model.pt\E$
^\Qpython/sklearnserver/sklearnserver/example_models/joblib/model/model.joblib\E$
^\Qpython/sklearnserver/sklearnserver/example_models/pickle/model/model.pickle\E$
^\Qpython/sklearnserver/sklearnserver/example_models/pkl/model.pkl\E$
^\Qpython/sklearnserver/sklearnserver/example_models/pkl/model/model.pkl\E$
^\Qpython/third_party/repo.txt\E$
^\Qpython/xgbserver/xgbserver/example_model/model/model.bst\E$
^\Qtest/benchmark/tf_vegeta_cfg.yaml\E$
^\Qtest/e2e/credentials/aws_credentials\E$
^\Qtest/e2e/credentials/azure_credentials.json\E$
^\Qtest/e2e/credentials/gcp_credentials.json\E$
^\Qtest/e2e/data/flower_input.json\E$
^\Qtest/e2e/data/image.json\E$
^\Qtest/e2e/data/jay.json\E$
^\Qtest/e2e/data/torchserve_batch_input.json\E$
^\Qtest/e2e/data/torchserve_input.json\E$
^\Qtest/e2e/data/transformer.json\E$
^\Qtest/workflows/lib/v1.7.0/k8s.libsonnet\E$
^\Qtest/workflows/lib/v1.7.0/swagger.json\E$
^\Qtools/tf2openapi/cmd/testdata/TestCensus.pb\E$
^\Qtools/tf2openapi/cmd/testdata/TestFlowers.pb\E$
^\Qtools/tf2openapi/cmd/testdata/TestInvalidSavedModel.pb\E$
^\Qtools/tf2openapi/cmd/testdata/TestPropagateOpenAPIGenerationError.pb\E$
^\Qtools/tf2openapi/generator/testdata/TestColFmtMultipleTensors.pb\E$
^\Qtools/tf2openapi/generator/testdata/TestColFmtScalar.pb\E$
^\Qtools/tf2openapi/generator/testdata/TestColFmtSingleTensor.pb\E$
^\Qtools/tf2openapi/generator/testdata/TestRowFmtMultipleTensors.pb\E$
^\Qtools/tf2openapi/generator/testdata/TestRowFmtMultipleTensorsReq.json\E$
^\Qtools/tf2openapi/generator/testdata/TestRowFmtSingleTensor.pb\E$

1 comment on commit 032bfa6

@github-actions
Copy link

@github-actions github-actions bot commented on 032bfa6 Dec 31, 2021

Choose a reason for hiding this comment

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

@check-spelling-bot Report

🔴 Please review

See the action log for details.

Unrecognized words (59)
Annotions
appened
arbitary
archieve
Architetcure
associaed
buildin
charcter
classificaton
Configuratione
contaienr
Contianer
contorl
Credentails
dowloader
Egresss
entitys
explaination
explaine
explantion
Fowarding
granfana
heruistic
Hugginface
iamge
indetified
inlcude
inlude
interpretting
KNaive
kuberenetes
licensces
lightbgm
modeule
overriden
Pacthed
pmlmserver
predicition
prediciton
predictons
previsous
provdes
querys
reoncile
requistes
requset
resouce
specificed
Storageg
tablular
tokenziation
tranformer
transistion
ture
ueries
Unkown
variabalize
worfklows
wraper
Previously acknowledged words that are now absent variabilize
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:jsoref/kserve.git repository
on the spell-check branch:

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/jsoref/kserve/comments/62745839" > "$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).

Please sign in to comment.