Skip to content

Commit

Permalink
check-spelling: added spelling check tool with generated file and wor…
Browse files Browse the repository at this point in the history
…d filters
  • Loading branch information
Payne-X6 committed Nov 18, 2021
1 parent 737af00 commit d2e84e6
Show file tree
Hide file tree
Showing 8 changed files with 4,338 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.
27 changes: 27 additions & 0 deletions .github/actions/spelling/advice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!-- See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice --> <!-- markdownlint-disable MD033 MD041 -->
<details><summary>If you see a bunch of garbage</summary>

If it relates to a ...
<details><summary>well-formed pattern</summary>

See if there's a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it.

If not, try writing one and 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.
</details>
<details><summary>binary-ish string</summary>

Please add a file path to the `excludes.txt` file instead of just accepting the garbage.

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>

</details>
Empty file.
162 changes: 162 additions & 0 deletions .github/actions/spelling/excludes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
(?:^|/)(?i)COPYRIGHT
(?:^|/)(?i)LICEN[CS]E
(?:^|/)package(?:-lock|)\.json$
(?:^|/)vendor/
ignore$
\.avi$
\.ico$
\.jpe?g$
\.lock$
\.map$
\.min\.
\.mod$
\.mp[34]$
\.png$
\.wav$
^\.github/
# Knot specific
^distro/pkg/deb/docs$
^distro/pkg/deb/knot-dnsutils\.install$
^distro/pkg/deb/knot\.install$
^distro/pkg/deb/libdnssec8\.install$
^distro/pkg/deb/libknot12\.install$
^distro/pkg/deb/libzscanner4\.install$
^distro/pkg/deb/watch$
^doc/doxygen/DoxygenLayout\.xml$
^scripts/docker/centos:latest/Dockerfile$
^scripts/docker/fedora:latest/Dockerfile$
^src/Makefile\.am$
^src/knot/modules/dnsproxy/Makefile\.inc$
^src/knot/modules/dnstap/Makefile\.inc$
^src/knot/modules/geoip/Makefile\.inc$
^src/knot/modules/synthrecord/Makefile\.inc$
^src/libdnssec\.pc\.in$
^src/libknot\.pc\.in$
^src/libknot/Makefile\.inc$
^src/libknot/xdp/bpf-kernel-obj\.c$
^src/utils/Makefile\.inc$
^tests-extra/data/\.zone$
^tests-extra/requirements\.txt$
^tests-extra/tests/axfr/cross_msg_compr/data/example\.zone$
^tests-extra/tests/axfr/zonemd/data/example\.zone$
^tests-extra/tests/basic/delegation_tc/data/tc\.test\.zone$
^tests-extra/tests/basic/nsec/data/example\.zone\.nsec$
^tests-extra/tests/basic/nsec3/data/example\.zone\.nsec3$
^tests-extra/tests/basic/opt-out/data/example\.zone$
^tests-extra/tests/ddns/basic/data/ddns\.zone$
^tests-extra/tests/dnssec/add_remove/data/example\.zone\.9$
^tests-extra/tests/dnssec/case_sensitivity/data/example\.zone$
^tests-extra/tests/dnssec/key_rollovers/data/public-only-ECDSAP256SHA256\.key$
^tests-extra/tests/dnssec/key_rollovers/data/public-only-ECDSAP384SHA384\.key$
^tests-extra/tests/dnssec/keytag_conflict/data/keys/data\.mdb$
^tests-extra/tests/dnssec/keytag_conflict/data/keys/keys/301d3fc5392e83ea02312dc5bdc1a9f0b7937ddf\.pem$
^tests-extra/tests/dnssec/keytag_conflict/data/keys/keys/6abddc73bcb46c4e6078cf764290ac315fff03f0\.pem$
^tests-extra/tests/dnssec/keytag_conflict/data/keys/keys/712d0d0d57fa0aa006b5e20cd84e23941e5f3ab2\.pem$
^tests-extra/tests/dnssec/keytag_conflict/data/keys/keys/7a3500c7feac3fd99f09a208a83b97f7455fa3e0\.pem$
^tests-extra/tests/dnssec/no_resign/data/example\.zone$
^tests-extra/tests/dnssec/no_resign/data/keys/data\.mdb$
^tests-extra/tests/dnssec/no_resign/data/keys/keys/keys/7ab95ab36eba53ee4091d085e87480373ee996a0\.pem$
^tests-extra/tests/dnssec/no_resign/data/keys/keys/keys/a5a724cb8396a1cfd3568dbe825f71be054b6a0b\.pem$
^tests-extra/tests/dnssec/no_resign2/data/example\.com\.zone$
^tests-extra/tests/dnssec/nsec3_up_adjust/data/example\.com\.zone$
^tests-extra/tests/dnssec/nsec_update/data/dk\.zone$
^tests-extra/tests/dnssec/validate/data/bitmap\.nsec\.zone$
^tests-extra/tests/dnssec/validate/data/bitmap\.nsec\.zone\.2$
^tests-extra/tests/dnssec/validate/data/bitmap\.nsec3\.zone$
^tests-extra/tests/dnssec/validate/data/bitmap\.nsec3\.zone\.2$
^tests-extra/tests/dnssec/validate/data/chain\.nsec\.zone$
^tests-extra/tests/dnssec/validate/data/chain\.nsec\.zone\.2$
^tests-extra/tests/dnssec/validate/data/chain\.nsec3\.zone$
^tests-extra/tests/dnssec/validate/data/chain\.nsec3\.zone\.2$
^tests-extra/tests/dnssec/validate/data/missing\.nsec\.zone$
^tests-extra/tests/dnssec/validate/data/missing\.nsec\.zone\.2$
^tests-extra/tests/dnssec/validate/data/missing\.nsec3\.zone$
^tests-extra/tests/dnssec/validate/data/missing\.nsec3\.zone\.2$
^tests-extra/tests/dnssec/validate/data/ok\.2nsec3\.zone$
^tests-extra/tests/dnssec/validate/data/ok\.2nsec3\.zone\.2$
^tests-extra/tests/dnssec/validate/data/ok\.nsec\.zone$
^tests-extra/tests/dnssec/validate/data/ok\.nsec\.zone\.2$
^tests-extra/tests/dnssec/validate/data/ok\.nsec3\.zone$
^tests-extra/tests/dnssec/validate/data/ok\.nsec3\.zone\.2$
^tests-extra/tests/dnssec/validate/data/optout\.ent\.zone$
^tests-extra/tests/dnssec/validate/data/optout\.ent\.zone\.2$
^tests-extra/tests/dnssec/validate/data/redundant\.invalid\.rrsig\.zone$
^tests-extra/tests/dnssec/validate/data/redundant\.invalid\.rrsig\.zone\.2$
^tests-extra/tests/dnssec/validate/data/rrsig\.a\.zone$
^tests-extra/tests/dnssec/validate/data/rrsig\.a\.zone\.2$
^tests-extra/tests/dnssec/validate/data/rrsig\.nsec\.zone$
^tests-extra/tests/dnssec/validate/data/rrsig\.nsec\.zone\.2$
^tests-extra/tests/dnssec/validate/data/rrsig\.nsec3\.zone$
^tests-extra/tests/dnssec/validate/data/rrsig\.nsec3\.zone\.2$
^tests-extra/tests/ixfr/axfr_style/data/xfr\.zone$
^tests-extra/tests/ixfr/from_differences/07_none_nsec_nsec3_none/example\.com\.zone\.1$
^tests-extra/tests/ixfr/from_differences/07_none_nsec_nsec3_none/example\.com\.zone\.2$
^tests-extra/tests/ixfr/from_differences/08_none_nsec3_nsec_none/example\.com\.zone\.1$
^tests-extra/tests/ixfr/from_differences/08_none_nsec3_nsec_none/example\.com\.zone\.2$
^tests-extra/tests/modules/geoip/data/db\.mmdb$
^tests-extra/tests/records/nsec_lettercase/data/rdatacase\.zone\.signed$
^tests-extra/tests/zone/backup/data/example\.key$
^tests-extra/tests/zone/backup/data/serial\.key$
^tests-extra/tests/zone/nsec3-empty/data/example\.com\.zone$
^tests-fuzz/fuzz_dname_to_str\.in/dname009\.bin$
^tests-fuzz/fuzz_dname_to_str\.in/dname011\.bin$
^tests/knot/semantic_check_data/cdnskey\.cds$
^tests/knot/semantic_check_data/cdnskey\.delete\.both$
^tests/knot/semantic_check_data/cdnskey\.delete\.invalid\.cdnskey$
^tests/knot/semantic_check_data/cdnskey\.delete\.invalid\.cds$
^tests/knot/semantic_check_data/cdnskey\.invalid$
^tests/knot/semantic_check_data/cdnskey\.invalid\.param$
^tests/knot/semantic_check_data/cdnskey\.nocdnskey$
^tests/knot/semantic_check_data/cdnskey\.nocds$
^tests/knot/semantic_check_data/cdnskey\.nodnskey$
^tests/knot/semantic_check_data/cdnskey\.orphan\.cdnskey$
^tests/knot/semantic_check_data/cdnskey\.orphan\.cds$
^tests/knot/semantic_check_data/cname_extra_02\.signed$
^tests/knot/semantic_check_data/different_signer_name\.signed$
^tests/knot/semantic_check_data/dname_apex_nsec3\.signed$
^tests/knot/semantic_check_data/dnskey_param_error\.signed$
^tests/knot/semantic_check_data/duplicate\.signature$
^tests/knot/semantic_check_data/invalid_ds\.signed$
^tests/knot/semantic_check_data/missing\.signed$
^tests/knot/semantic_check_data/no_error_delegaton_bitmap\.signed$
^tests/knot/semantic_check_data/no_error_nsec3_delegation\.signed$
^tests/knot/semantic_check_data/no_error_nsec3_optout\.signed$
^tests/knot/semantic_check_data/no_rrsig\.signed$
^tests/knot/semantic_check_data/no_rrsig_with_delegation\.signed$
^tests/knot/semantic_check_data/nsec3_chain_01\.signed$
^tests/knot/semantic_check_data/nsec3_chain_02\.signed$
^tests/knot/semantic_check_data/nsec3_chain_03\.signed$
^tests/knot/semantic_check_data/nsec3_ds\.signed$
^tests/knot/semantic_check_data/nsec3_missing\.signed$
^tests/knot/semantic_check_data/nsec3_optout\.signed$
^tests/knot/semantic_check_data/nsec3_optout_ent\.all$
^tests/knot/semantic_check_data/nsec3_optout_ent\.invalid$
^tests/knot/semantic_check_data/nsec3_optout_ent\.valid$
^tests/knot/semantic_check_data/nsec3_param_invalid\.signed$
^tests/knot/semantic_check_data/nsec3_wrong_bitmap_01\.signed$
^tests/knot/semantic_check_data/nsec3_wrong_bitmap_02\.signed$
^tests/knot/semantic_check_data/nsec_broken_chain_01\.signed$
^tests/knot/semantic_check_data/nsec_broken_chain_02\.signed$
^tests/knot/semantic_check_data/nsec_missing\.signed$
^tests/knot/semantic_check_data/nsec_multiple\.signed$
^tests/knot/semantic_check_data/nsec_wrong_bitmap_01\.signed$
^tests/knot/semantic_check_data/nsec_wrong_bitmap_02\.signed$
^tests/knot/semantic_check_data/rrsig_rdata_ttl\.signed$
^tests/knot/semantic_check_data/rrsig_signed\.signed$
^tests/knot/semantic_check_data/rrsig_ttl\.signed$
^tests/libzscanner/TESTS$
^tests/libzscanner/data/00-3_general\.out$
^tests/libzscanner/data/06-0_INCLUDE\.out$
^tests/libzscanner/data/06-8_INCLUDE\.out$
^tests/libzscanner/data/07-2-rdata\.out$
^tests/libzscanner/data/07-3-rdata\.out$
^tests/libzscanner/data/07-4-rdata\.out$
^tests/libzscanner/data/13_SPF\.out$
^tests/libzscanner/data/15_CNAME\.out$
^tests/libzscanner/data/16_PTR\.out$
^tests/libzscanner/data/17_DNAME\.out$
^tests/libzscanner/data/24_RP\.out$
^tests/libzscanner/data/32_APL\.out$
^tests/libzscanner/data/42_LOC\.out$
^tests/libzscanner/data/54_OPENPGPKEY\.out$
Loading

1 comment on commit d2e84e6

@github-actions
Copy link

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 or 📝 job summary for details.

Unrecognized words (7)

necho
ngot
nosubgrouping
nreference
u'nths
u'nutes
thmac

Previously acknowledged words that are now absent dbe eba eturn etval nths nutes odo osubgrouping ote 🫥
Some files were automatically ignored 🙈

These sample patterns would exclude them:

[^/]\.mdb$
^\Qsrc/libzscanner/scanner.c.g2\E$
^\Qtests/knot/test_digest.c\E$
^\Qtests/knot/test_kasp_db.c\E$
^\Qtests/libdnssec/sample_keys.h\E$

You should consider excluding directory paths (e.g. (?:^|/)vendor/), filenames (e.g. (?:^|/)yarn\.lock$), or file extensions (e.g. \.gz$)

You should consider adding them to:

.github/actions/spelling/excludes.txt

File matching is via Perl regular expressions.

To check these files, more of their words need to be in the dictionary than not. You can use patterns.txt to exclude portions, add items to the dictionary (e.g. by adding them to allow.txt), or fix typos.

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words and update file exclusions, you could run the following commands

... in a clone of the [email protected]:CZ-NIC/knot.git repository
on the check-spelling branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/main/apply.pl' |
perl - 'https://github.com/CZ-NIC/knot/actions/runs/10574418699/attempts/1'
Available 📚 dictionaries could cover words (expected and unrecognized) not in the 📘 dictionary

This includes both expected items (4091) from .github/actions/spelling/expect.txt and unrecognized words (7)

Dictionary Entries Covers Uniquely
cspell:software-terms/dict/softwareTerms.txt 1288 147 50
cspell:php/dict/php.txt 1689 150 25
cspell:python/src/python/python-lib.txt 2417 149 25
cspell:node/dict/node.txt 891 109 19
cspell:python/src/common/extra.txt 741 33 18

Consider adding them (in .github/workflows/spelling.yml):

      with:
        extra_dictionaries:
          cspell:software-terms/dict/softwareTerms.txt
          cspell:php/dict/php.txt
          cspell:python/src/python/python-lib.txt
          cspell:node/dict/node.txt
          cspell:python/src/common/extra.txt

To stop checking additional dictionaries, add (in .github/workflows/spelling.yml):

check_extra_dictionaries: ''
Warnings (3)

See the 📜action log or 📝 job summary for details.

ℹ️ Warnings Count
ℹ️ large-file 1
ℹ️ minified-file 16
ℹ️ noisy-file 3

See ℹ️ Event descriptions for more information.

If you see a bunch of garbage

If it relates to a ...

well-formed pattern

See if there's a pattern that would match it.

If not, try writing one and 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-ish string

Please add a file path to the excludes.txt file instead of just accepting the garbage.

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.