Skip to content

Commit

Permalink
add husky and cspell for grammar check
Browse files Browse the repository at this point in the history
  • Loading branch information
gkaravatski committed Oct 2, 2024
1 parent 1f17943 commit 9fb14f5
Show file tree
Hide file tree
Showing 70 changed files with 2,669 additions and 190 deletions.
1 change: 1 addition & 0 deletions .husky/_/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
2 changes: 2 additions & 0 deletions .husky/_/applypatch-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
22 changes: 22 additions & 0 deletions .husky/_/h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env sh
[ "$HUSKY" = "2" ] && set -x
n=$(basename "$0")
s=$(dirname "$(dirname "$0")")/$n

[ ! -f "$s" ] && exit 0

if [ -f "$HOME/.huskyrc" ]; then
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh"
fi
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh"
[ -f "$i" ] && . "$i"

[ "${HUSKY-}" = "0" ] && exit 0

export PATH="node_modules/.bin:$PATH"
sh -e "$s" "$@"
c=$?

[ $c != 0 ] && echo "husky - $n script failed (code $c)"
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
exit $c
9 changes: 9 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
echo "husky - DEPRECATED
Please remove the following two lines from $0:
#!/usr/bin/env sh
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
They WILL FAIL in v10.0.0
"
2 changes: 2 additions & 0 deletions .husky/_/post-applypatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/post-rewrite
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-applypatch
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-auto-gc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
14 changes: 14 additions & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh

STAGED=$(git diff --cached --name-only)

echo "Running cspell on staged files..."
echo "$STAGED" | xargs ./node_modules/.bin/cspell --show-suggestions

if [ $? -ne 0 ]; then
echo "❌ Commit failed: Spelling errors detected by cspell."
exit 1
fi

echo "✅ No spelling errors found."
exit 0
2 changes: 2 additions & 0 deletions .husky/_/pre-merge-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/pre-rebase
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
2 changes: 2 additions & 0 deletions .husky/_/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
. "$(dirname "$0")/h"
289 changes: 289 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
"version": "0.2",
"language": "en",
"files": [
"**/*.md",
"**/*.mdx",
],
"dictionaries": ["tvm-instructions", "names", "commands"],
"dictionaryDefinitions": [
{
"name":"tvm-instructions",
"path":"./src/grammar/tvm-dictionary.txt"
},
{
"name":"names",
"path":"./src/grammar/names-dictionary.txt"
},
{
"name":"commands",
"path":"./src/grammar/commands-dictionary.txt"
},
],
"words": [
"ADNL",
"ASIC",
"ASICS",
"Aiogram",
"Altcoin",
"Astralyx",
"Blockczech",
"Blockczech R&D Lab",
"CRC16-CCITT",
"Ceora",
"Cheatsheet",
"Cheatsheets",
"Circom",
"Coalus",
"Coinvent",
"Comptime",
"cpell",
"DICTGET",
"DIMM",
"DYOR",
"Datagram",
"Decompilation",
"Descr",
"ECDH",
"Egbt",
"EvaCodes",
"Everscale",
"Excno",
"Extracurrency",
"Fift",
"Gbit",
"Gbps",
"Gravi",
"Hackathon",
"Highlevel",
"IPFS",
"InMsgDescr",
"Indo-European",
"Januar",
"Jetton",
"Jettons",
"Kademlia",
"Keccak",
"Masterchain",
"Mbit",
"Merkle",
"Metaverse",
"Multiplatform",
"Mytonctrl",
"NVME",
"Notcoin",
"Offchain",
"OutMsgDescr",
"PRNG",
"Pixelplex",
"Prer",
"Prerequisites",
"RAWRESERVE",
"RLDP",
"Reindexing",
"Relatedly",
"STON.fi",
"Satoshi",
"Seamus",
"Shardchain",
"Snarkjs",
"Solana",
"Soulbound",
"Speedrun",
"Stablecoin",
"Stablecoins",
"TIMELOCK",
"TWWW",
"Testne",
"Threadripper-based",
"Timeouted",
"Toncoin",
"Toncoins",
"Underload",
"Uninit",
"WAGMI",
"Watchlist",
"Weil",
"Workstreams",
"XLARGE",
"XMODEM",
"Ybgx",
"aabbcc",
"accountchain",
"accountchains",
"aiogram",
"altcoin",
"altcoins",
"asms",
"basechain",
"berfest",
"bitmask",
"bitstring",
"bitstrings",
"blockbook",
"bounceable",
"bytestring",
"catchain",
"cheatsheet",
"cheatsheets",
"chksgn",
"ciphertexts",
"codomain",
"comptime",
"crosschain",
"cryptobot",
"cryptosystem",
"cryptosystems",
"datagram",
"datagrams",
"decompilation",
"decompiles",
"decompiling",
"deeplink",
"dnsresolve",
"dracones",
"ed25519_chksign",
"exitcode",
"extracurrencies",
"extracurrency",
"fiftlib",
"float",
"frontends",
"gamification",
"gennaio",
"getgems",
"hashmark",
"hashmarks",
"hashrate",
"hashrates",
"hehehe",
"highlevel",
"highload",
"hmac",
"inclusivity",
"inplace",
"int",
"ints",
"ipfs",
"janvier",
"jetton",
"jettons",
"jojo",
"keccak",
"keyblocks",
"keypair",
"keystream",
"leaderboard",
"leaderboards",
"liteserver",
"liteservers",
"long",
"masterchain",
"mathrm",
"micropayment",
"micropayments",
"mintable",
"multichain",
"multisignature",
"mystore",
"mystore.ton",
"mytonctrl",
"nacl",
"nanocoins",
"nanogram",
"nanotons",
"newkeypair",
"nextra",
"nonexist",
"precomplied",
"preimage",
"prer",
"presales",
"previsit",
"pythonlib",
"qrcode",
"quadtree",
"quadtrees",
"randomizer",
"reindex",
"respecifying",
"runvmcode",
"seamus",
"seck256r1",
"seck256r1-signature",
"secp256k1",
"secp256r1",
"selfcheck",
"seqno",
"seqnos",
"shardblocks",
"shardchain",
"shardchains",
"skillset",
"softstack",
"stablecoin",
"stablecoins",
"startapp",
"stdlibs",
"subarrays",
"subdictionary",
"subnetwork",
"subnetworks",
"subresolver",
"sunt",
"superserver",
"tick-tock",
"timeouted",
"tock",
"tokenomics",
"tvmbeta",
"udict",
"uint",
"unbounceable",
"underload",
"underloaded",
"unixtime",
"workchain",
"workchains",
"xguard",
"xlarge",
"xtwitter",
"yourname",
"zerostate",
],
"ignoreRegExpList": [
"\\(#.*\\)",
"^\\[.+\\]: .+", // link declarations like [foo]: /ref/stdlib-ownable#bar
"\\[.+\\]\\[.+\\]", // links like [`Resumable{:tact}`][res]
"\\[.*\\]\\(.+\\)", // links like [`self.toCell().asSlice(){:tact}`](/ref/core-cells#cellasslice)
"address\\(\".+\"\\)", // Ton addresses
"mathrm\\{.+\\}", // LaTeX subset
"\\[#.+\\]", // [#nativereserve-combining-modes-with-flags]
"href=\".+\"", // href="/cookbook/dexes/stonfi"
"\".+\": \".+\"", // "from": "kQBrSAP2y7QIUw4_1q0qciHfqdFmOYR9CC1oinn7kyWWRuoV",
"Urls",
"EQ.+", // addresses
"Pub.+", // addresses
"kf.+", // addresses
"[Tt]on\\w*",
"```[\\s\\S]*```", // code snippets
"\/?([\\w\\-]+\/)*[\\w\\-]+\\.[a-zA-Z]{1,5}", // path
],
"flagWords": [],
"ignorePaths": [
"static",
"node_modules",
"package.json",
"cspell.json",
"docusaurus.config.js",
"prism-theme.js",
"src",
"deployment",
"docs/learn/tvm-instructions/instructions.csv",
"docs/learn/tvm-instructions/generate_md.py",
"sidebars.js",
"i18n",
".husky",
]
}
Loading

0 comments on commit 9fb14f5

Please sign in to comment.