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

Configuration of cargo-spellcheck #832

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
90 changes: 90 additions & 0 deletions .config/lingua.dic
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
90
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, where'd you get this list from?

Also, what's with the /<letter> at the end of certain words?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is kinda...it is called Hunspell and by that letters it is allowed to specify kind of dictionary like "en_US". Paste from the documentation:

If the .dic files contains incorrect rules for a word, then add the word with the correct rules to .dic_delta. For example, if en_US.dic contains the entry raccoon/M, but the rule should be /MS, then add raccoon/MS to en_US.dic_delta. Rules for entries in .dic_delta override the rules for entries in .dic.

Source: https://www.chromium.org/developers/how-tos/editing-the-spell-checking-dictionaries

What is the source of the list? Well, long story short, around 2 months ago I was thinking that the task will take me ~1h and started to do it, but it was not so simple and was needed to leave it, but I to follow and look at Parity's repositories and I found that PR: https://github.com/paritytech/polkadot/pull/1841/files and my dream is to do at least one merge/ed PR and when I saw the PR I immediately made my PR.

That is it, that's the story.

Copy link
Contributor

Choose a reason for hiding this comment

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

It is kinda...it is called Hunspell and by that letters it is allowed to specify kind of dictionary like "en_US". Paste from the documentation:

If the .dic files contains incorrect rules for a word, then add the word with the correct rules to .dic_delta. For example, if en_US.dic contains the entry raccoon/M, but the rule should be /MS, then add raccoon/MS to en_US.dic_delta. Rules for entries in .dic_delta override the rules for entries in .dic.

Source: https://www.chromium.org/developers/how-tos/editing-the-spell-checking-dictionaries

I still don't fully get it, but good to know there's a source for the strangeness 😅

What is the source of the list? Well, long story short, around 2 months ago I was thinking that the task will take me ~1h and started to do it, but it was not so simple and was needed to leave it, but I to follow and look at Parity's repositories and I found that PR: https://github.com/paritytech/polkadot/pull/1841/files and my dream is to do at least one merge/ed PR and when I saw the PR I immediately made my PR.

That is it, that's the story.

Haha, sounds good! Keep in mind that you will need to add some "bridge" specific words in there though (e.g our test networks Rialto and Millau). I'm not sure what other false positives you'll get, but I imagine there'll be a few.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

spellcheck.mp4

@HCastano I wanted to check output from the commands like in recording but I got empty output, I have missed something all it works like supposed to work?

annualised/MS
Apache-2.0/M
api/SM
API/SM
APIs
async
BFT/M
bitfield/MS
blake2/MS
blockchain/MS
borked
BTC/S
CLI/MS
config/MS
crypto/MS
customizable/B
debian/M
decodable/MS
DOT/S
ed25519
enum/MS
ERC-20
ethereum/MS
externality/MS
extrinsic/MS
extrinsics
fedora/M
GiB/S
GPL/M
GPLv3/M
Handler/MS
https
inherent/MS
initialize/RG
instantiate/B
intrinsic/MS
intrinsics
io
js
keccak256/M
KSM/S
kusama/S
KYC/M
merkle/MS
misbehavior/SM
misbehaviors
MIT/M
multivalidator/SM
oneshot/MS
others'
parablock/MS
parachain/MS
parameterize/D
polkadot/MS
pov-block/MS
PoV/MS
promethius
promethius'
provisioner/MS
redhat/M
repo/MS
RPC/MS
runtime/MS
rustc/MS
sr25519
struct/MS
subsystem/MS
subsystems'
taskmanager/MS
teleport/RG
teleportation/SM
teleporter/SM
teleporters
testnet/MS
trie/MS
trustless/Y
ubuntu/M
union/MSG
unservable/B
validator/SM
w3f/MS
wasm/M
WND/S
XCM/S
XCMP/M
include/BG
isolate/BG
Rialto
Millau
11 changes: 11 additions & 0 deletions .config/spellcheck.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[hunspell]
lang = "en_US"
search_dirs = ["."]
extra_dictionaries = ["lingua.dic"]

[hunspell.quirks]
# `Type`'s
# 5x
transform_regex = ["^'([^\\s])'$", "^[0-9]+(?:\\.[0-9]*)?x$", "^'s$", "^\\+$"]
allow_concatenation = true
allow_dashes = true
11 changes: 11 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,14 @@ jobs:
with:
command: fmt
args: --all -- --check
check-spellcheck:
name: Check For Spelling and/or Grammar Mistakes
runs-on: ubuntu-latest
env:
RUST_BACKTRACE: full
steps:
- name: Add cargo-spellcheck
run: rustup component add cargo-spellcheck

- name: Run cargo-spellcheck
run: cargo spellcheck check
TomaszWaszczyk marked this conversation as resolved.
Show resolved Hide resolved