diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..7c28311 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,304 @@ +// See: https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell +{ + "version": "0.2", + // language - current active spelling language + "language": "en", + // dictionaries - list of the names of the dictionaries to use + "dictionaries": [ + "en_US", + "softwareTerms", + "c", + "cpp", + "python", + "python-custom", + "rust", + "unix", + "posix", + "winapi" + ], + // dictionaryDefinitions - this list defines any custom dictionaries to use + "dictionaryDefinitions": [], + "ignorePaths": [ + "**/__pycache__/**", + "Lib/**" + ], + // words - list of words to be always considered correct + "words": [ + // Rust + "ahash", + "bidi", + "biguint", + "bindgen", + "bitflags", + "bstr", + "byteorder", + "chrono", + "consts", + "cstring", + "flate2", + "fract", + "hasher", + "hexf", + "idents", + "indexmap", + "insta", + "keccak", + "lalrpop", + "libc", + "libz", + "longlong", + "Manually", + "nbaz", + "maplit", + "memchr", + "memrchr", + "memmap", + "metas", + "modpow", + "nanos", + "peekable", + "powc", + "powf", + "prepended", + "punct", + "replacen", + "rsplitn", + "rustc", + "rustfmt", + "seekfrom", + "splitn", + "subsec", + "timsort", + "trai", + "ulonglong", + "unic", + "unistd", + "unsync", + "winapi", + "winsock", + // Python + "abstractmethods", + "aiter", + "anext", + "arrayiterator", + "arraytype", + "asend", + "athrow", + "basicsize", + "cformat", + "classcell", + "closesocket", + "codepoint", + "codepoints", + "cpython", + "decompressor", + "defaultaction", + "descr", + "dictcomp", + "dictitems", + "dictkeys", + "dictview", + "docstring", + "docstrings", + "dunder", + "eventmask", + "fdel", + "fget", + "fileencoding", + "fillchar", + "finallyhandler", + "frombytes", + "fromhex", + "fromunicode", + "fset", + "fspath", + "fstring", + "fstrings", + "genexpr", + "getattro", + "getformat", + "getnewargs", + "getweakrefcount", + "getweakrefs", + "hostnames", + "idiv", + "impls", + "infj", + "instancecheck", + "instanceof", + "isabstractmethod", + "itemiterator", + "itemsize", + "iternext", + "keyiterator", + "kwarg", + "kwargs", + "linearization", + "linearize", + "listcomp", + "mappingproxy", + "maxsplit", + "memoryview", + "memoryviewiterator", + "metaclass", + "metaclasses", + "metatype", + "mro", + "mros", + "nanj", + "ndigits", + "ndim", + "nonbytes", + "origname", + "posixsubprocess", + "pyexpat", + "PYTHONDEBUG", + "PYTHONHOME", + "PYTHONINSPECT", + "PYTHONOPTIMIZE", + "PYTHONPATH", + "PYTHONPATH", + "PYTHONVERBOSE", + "PYTHONWARNINGS", + "qualname", + "radd", + "rdiv", + "rdivmod", + "reconstructor", + "reversevalueiterator", + "rfloordiv", + "rlshift", + "rmod", + "rpow", + "rrshift", + "rsub", + "rtruediv", + "scproxy", + "setattro", + "setcomp", + "stacklevel", + "subclasscheck", + "subclasshook", + "unionable", + "unraisablehook", + "valueiterator", + "vararg", + "varargs", + "varnames", + "warningregistry", + "warnopts", + "weakproxy", + "xopts", + // RustPython + "baseclass", + "Bytecode", + "cfgs", + "codegen", + "dedentations", + "dedents", + "deduped", + "downcasted", + "dumpable", + "GetSet", + "internable", + "makeunicodedata", + "miri", + "nonterminal", + "notrace", + "pyarg", + "pyarg", + "pyargs", + "PyAttr", + "pyc", + "PyClass", + "PyClassMethod", + "PyException", + "PyFunction", + "pygetset", + "pyimpl", + "pymember", + "PyMethod", + "PyModule", + "pyname", + "pyobj", + "PyObject", + "pypayload", + "PyProperty", + "pyref", + "PyResult", + "pyslot", + "PyStaticMethod", + "pystr", + "pystruct", + "pystructseq", + "pytrace", + "reducelib", + "richcompare", + "RustPython", + "struc", + "tracebacks", + "typealiases", + "Unconstructible", + "unhashable", + "uninit", + "unraisable", + "wasi", + "zelf", + // cpython + "argtypes", + "asdl", + "asname", + "augassign", + "badsyntax", + "basetype", + "boolop", + "bxor", + "cellarg", + "cellvar", + "cellvars", + "cmpop", + "dictoffset", + "elts", + "excepthandler", + "finalbody", + "freevar", + "freevars", + "fromlist", + "heaptype", + "IMMUTABLETYPE", + "kwonlyarg", + "kwonlyargs", + "linearise", + "maxdepth", + "mult", + "nkwargs", + "orelse", + "patma", + "posonlyarg", + "posonlyargs", + "prec", + "significand", + "stackdepth", + "unaryop", + "unparse", + "unparser", + "VARKEYWORDS", + "varkwarg", + "wbits", + "withitem", + "withitems", + "withs" + ], + // flagWords - list of words to be always considered incorrect + "flagWords": [ + ], + "ignoreRegExpList": [ + ], + // languageSettings - allow for per programming language configuration settings. + "languageSettings": [ + { + "languageId": "python", + "locale": "en" + } + ] +} diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 18f9e9d..4ecd211 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -62,3 +62,12 @@ jobs: run: python -m pip install ruff - name: run python lint run: ruff --ignore=E501 ast --show-source + + - name: spell checker + uses: streetsidesoftware/cspell-action@v2 + with: + files: | + 'ast/**/*.rs' + 'core/**/*.rs' + 'literal/**/*.rs' + 'parser/**/*.rs' diff --git a/ast/src/lib.rs b/ast/src/lib.rs index 66c7804..45fb1fb 100644 --- a/ast/src/lib.rs +++ b/ast/src/lib.rs @@ -32,6 +32,7 @@ pub mod fold { #[cfg(feature = "visitor")] mod visitor { use super::generic::*; + include!("gen/visitor.rs"); } diff --git a/literal/src/escape.rs b/literal/src/escape.rs index de7a514..921d3dc 100644 --- a/literal/src/escape.rs +++ b/literal/src/escape.rs @@ -65,7 +65,7 @@ pub(crate) const fn choose_quote( Quote::Double => (double_count, single_count), }; - // always use primary unless we have primary but no seconday + // always use primary unless we have primary but no secondary let use_secondary = primary_count > 0 && secondary_count == 0; if use_secondary { (preferred_quote.swap(), secondary_count) @@ -242,7 +242,7 @@ impl<'a> Escape for UnicodeEscape<'a> { } #[cfg(test)] -mod unicode_escapse_tests { +mod unicode_escape_tests { use super::*; #[test] diff --git a/scripts/cspell.sh b/scripts/cspell.sh new file mode 100644 index 0000000..62f8cf2 --- /dev/null +++ b/scripts/cspell.sh @@ -0,0 +1,2 @@ +#!/bin/bash +cspell "ast/**/*.rs" "literal/**/*.rs" "core/**/*.rs" "parser/**/*.rs"