-
Notifications
You must be signed in to change notification settings - Fork 298
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
Add spell checking to linter step #8001
Conversation
Note that this is currently only enabled on Linux, because: - check-spelling does not support Windows - on macOS, check-spelling fails to ignore long words listed in expect.txt (check-spelling/check-spelling#84) Signed-off-by: Mark Yen <mark.yen@suse.com>
I don't really care for the But for TwoCows, and especially for I think for trivial YAML and JSON operations we can use In this particular case I think this is just a readable as the TypeScript code: ❯ cat spelling.sh
yq -o=json '.jobs.spelling.steps[] | select(.id == "spelling").with |
del(.experimental_apply_changes_via_bot, .use_sarif) | tojson' \
.github/workflows/spelling.yml
❯ eval "INPUT=$(./spelling.sh)"
❯ echo $INPUT
{
"suppress_push_for_open_pull_request": 1,
"checkout": true,
"check_file_names": 1,
"spell_check_this": "rancher-sandbox/rancher-desktop@main",
"post_comment": 0,
"use_magic_file": 1,
"report-timing": 1,
"warnings": "bad-regex,binary-file,deprecated-feature,large-file,limited-references,no-newline-at-eof,noisy-file,non-alpha-in-dictionary,token-is-substring,unexpected-line-ending,whitespace-in-dictionary,minified-file,unsupported-configuration,no-files-to-check",
"extra_dictionary_limit": 20,
"extra_dictionaries": "cspell:software-terms/dict/softwareTerms.txt cspell:k8s/dict/k8s.txt cspell:node/dict/node.txt cspell:aws/aws.txt cspell:golang/dict/go.txt cspell:php/dict/php.txt cspell:python/src/python/python-lib.txt cspell:typescript/dict/typescript.txt cspell:npm/dict/npm.txt cspell:shell/dict/shell-all-words.txt cspell:html/dict/html.txt cspell:filetypes/filetypes.txt cspell:fullstack/dict/fullstack.txt cspell:python/src/common/extra.txt cspell:java/src/java.txt cspell:dotnet/dict/dotnet.txt cspell:css/dict/css.txt cspell:django/dict/django.txt cspell:docker/src/docker-words.txt cspell:cpp/src/stdlib-cmath.txt cspell:python/src/python/python.txt cspell:powershell/dict/powershell.txt"
} |
Ah, I didn't trust |
We install rancher-desktop/.github/workflows/smoke-test.yaml Lines 115 to 129 in 9d8451e
I think that should just be moved to our |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on openSUSE Tumbleweed.
sudo zipper in perl-App-cpanminus
export PERL5LIB=/home/jan/perl5/lib/perl5
yarn lint:spelling
Note that this is currently only enabled on Linux, because:
expect.txt
more than 30 chars long are ignored check-spelling/check-spelling#84)This is written in TypeScript instead of pure shell because it involves reading YAML and writing JSON (in
INPUTS
); I didn't want to deal with that in shell. If you think it's better, I can rewrite this in go and do ago run …
instead?