From 9f5c165fd800710380eed69013b59f87c01c5e8d Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Sat, 27 Jan 2024 17:54:13 -0800 Subject: [PATCH] autopopulate spellchecker (#1749) Builds upon #1587. Extract all symbol names that are not native to the current project and insert them into our own custom spell checking dictionary's "words" list. The premise is that symbols that *are* native to our project should be spellchecked, but foreign symbols that constitute unrecognized dictionary words are presumably intentionally spelled that way. # Convention Manually-added words (i.e. for names in code that we've written for this project) will go into `.vscode/settings.json`. The automatically generated word list from third-party packages goes into `cspell.json`. # Usage scripts/spellcheck/autopopulate-spellchecker.sh --- .vscode/settings.json | 37 +- cspell.json | 1455 +++++++++++++++++ scripts/reformat-code.sh | 2 +- .../spellcheck/autopopulate-spellchecker.sh | 45 + scripts/spellcheck/split-module-names.hs | 28 + 5 files changed, 1531 insertions(+), 36 deletions(-) create mode 100644 cspell.json create mode 100755 scripts/spellcheck/autopopulate-spellchecker.sh create mode 100755 scripts/spellcheck/split-module-names.hs diff --git a/.vscode/settings.json b/.vscode/settings.json index 7babdf58..734e8f7e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,92 +16,63 @@ "antiquotation", "antiquoted", "antiquoting", - "assocs", "autoplay", - "Bifunctor", - "bimap", "Blackhole", "Blackholes", "bquote", "Bytestring", "callsite", - "cata", - "CESK", "Cmds", - "Colour", - "Combinators", "conv", "Corasick", "datatypes", "determinator", "determinators", - "distrib", "eithers", - "elems", "ents", "floorplan", "Focusable", - "foldl", - "foldr", "Gameplay", - "Hashable", "hifi", "HLINT", "homomorphic", - "hsep", - "Ixed", "JSONE", "Keymap", "kolor", "leaderboard", - "mappend", - "mconcat", - "mempty", - "Monoid", "multiset", "multiworld", + "notif", "objs", "omni", "Parameterizable", "parens", "pathfinding", - "Perlin", - "perp", "playfield", "Polytype", "polytypes", "pparens", "prec", "precomputation", - "Precompute", "preprocess", "prereq", "prereqs", - "Prettyprinter", - "preuse", "previewable", "pushable", "quasiquoter", "quasiquoters", - "sconcat", + "reqs", "scrollability", "selfdestruct", - "Semigroup", - "snoc", - "Splittable", "squote", - "SRGB", "struct", "Structs", "Subdir", - "Substate", "subrecord", "subterms", "subtyping", "Subworld", "subworlds", - "succ", - "reqs", "teleporting", "Tiebreaking", "toplevel", @@ -112,13 +83,9 @@ "typeclass", "ucata", "Unchainable", - "uncurry", "unequip", - "unfoldr", - "uniplate", "unranked", "Unwalkable", - "unwords", "upperleft", "vals", "verbed", diff --git a/cspell.json b/cspell.json new file mode 100644 index 00000000..1cd8d05b --- /dev/null +++ b/cspell.json @@ -0,0 +1,1455 @@ +{ + "version": "0.2", + "words": [ + "abs", + "Accum", + "AcyclicSCC", + "add", + "Add", + "addAttributes", + "Additive", + "adjust", + "Aeson", + "AesonException", + "Affine", + "AhoCorasick", + "alg", + "Algebra", + "Algorithms", + "Aliases", + "align", + "AlignCenter", + "alignLeft", + "AlignLeft", + "alignRight", + "all", + "allM", + "alphaNumChar", + "Alternative", + "any", + "anySingle", + "API", + "App", + "appAttrMap", + "appChooseCursor", + "appDraw", + "appE", + "AppE", + "append", + "appendFile", + "AppEvent", + "appHandleEvent", + "Application", + "Applicative", + "applyAttrMappings", + "applyBindings", + "applyEdit", + "appStartEvent", + "Arr", + "Array", + "Arrow", + "Ascii", + "AsEmpty", + "ASetter'", + "ask", + "assocs", + "AStar", + "aStarM", + "asum", + "at", + "At", + "Attr", + "attribute", + "Attributes", + "attrMap", + "AttrMap", + "attrName", + "AttrName", + "auto", + "AvailablePerLine", + "availHeightL", + "availWidthL", + "BAnd", + "Base", + "BChan", + "BConst", + "between", + "BFalse", + "bg", + "Bifunctor", + "bimap", + "binary", + "Bitraversable", + "Bits", + "black", + "BLeft", + "blink", + "blockQuote", + "Blocks", + "blue", + "BMiddle", + "BNot", + "bold", + "bool", + "Bool", + "BoolExpr", + "boolTreeToDNF", + "BOr", + "Border", + "borderAttr", + "borderWithLabel", + "both", + "Bounded", + "bounds", + "braces", + "BracketedPaste", + "brackets", + "break", + "brewerSet", + "BrewerSet", + "Brick", + "BrickEvent", + "BRight", + "brightRed", + "brightYellow", + "BTrue", + "Builder", + "buttonSelectedAttr", + "Bwd", + "ByteString", + "C1", + "cached", + "canonicalizePath", + "Capture", + "Carrier", + "CaseInsensitive", + "cast", + "cata", + "catch", + "Catch", + "catchError", + "catchIOError", + "Category", + "catMaybes", + "center", + "Center", + "centerLayer", + "char", + "Char", + "charLiteral", + "choice", + "Choice", + "chop", + "chr", + "chunksOf", + "CIE", + "Class", + "Classes", + "clickable", + "Client", + "Clock", + "cluster", + "code", + "codeBlock", + "Codec", + "coerce", + "Color", + "ColorMode", + "ColorMode16", + "ColorMode240", + "ColorMode8", + "Colour", + "columnBorders", + "Combinators", + "command", + "Common", + "commonmark", + "Commonmark", + "commonmarkWith", + "compare", + "comparing", + "Conc", + "concat", + "concatMap", + "concatWith", + "conE", + "Config", + "configPreferredColorMode", + "Conj", + "conName", + "cons", + "Cons", + "Console", + "const", + "Const", + "constants", + "Constraint", + "Constructor", + "constructorTagModifier", + "Containers", + "contains", + "ContentTypes", + "Context", + "continueWithoutRedraw", + "Contravariant", + "Control", + "Core", + "cos", + "count", + "createDirectoryIfMissing", + "CrossPlatform", + "CursorLocation", + "customMain", + "cyan", + "D", + "Data", + "dataToExpQ", + "decimal", + "decodeEither'", + "decodeFileEither", + "DecsQ", + "def", + "defAttr", + "Default", + "defaultConfig", + "defaultFileServerSettings", + "defaultJSONKeyOptions", + "defaultLayoutOptions", + "defaultNounPlural", + "defaultOptions", + "defaultSettings", + "defaultSyntaxSpec", + "defaultTabWidth", + "defaultTimeLocale", + "defaultVerbStuff", + "defaultWrapSettings", + "Definition", + "defRenderingOptions", + "delete", + "Diagnostic", + "Diagnostics", + "dialog", + "Dialog", + "dialogSelection", + "difference", + "diffTimeSpec", + "diffUTCTime", + "Digest", + "dim", + "Direction", + "Directory", + "Disj", + "disjoint", + "displayException", + "distance", + "distrib", + "div", + "DList", + "DNF", + "doc", + "Doc", + "DocCapture", + "DocIntro", + "Docs", + "docsWithIntros", + "doesDirectoryExist", + "doesFileExist", + "doInitialize", + "Dot", + "Double", + "Down", + "drawTree", + "drop", + "dropEnd", + "dropExtension", + "dropMissing", + "dropTrailingPathSeparator", + "dropWhile", + "dropWhileEnd", + "DsError", + "DsWarning", + "DtUnnecessary", + "edge", + "Edges", + "Edit", + "editFocusedAttr", + "Editor", + "editorText", + "Effect", + "either", + "Either", + "eitherDecodeFileStrict", + "eitherToMaybe", + "elem", + "elems", + "emph", + "empty", + "_Empty", + "Empty", + "emptyDoc", + "EmptyR", + "emptyWidget", + "enclose", + "encloseSep", + "encodeFile", + "encodeUtf8", + "Encoding", + "English", + "entity", + "Enum", + "enumerate", + "Enumeration", + "Environment", + "eof", + "Eq", + "EQ", + "Equality", + "Err", + "error", + "Error", + "errorBundlePretty", + "ErrorC", + "escapedChar", + "evalBoolExpr", + "evalIntBindingT", + "evalState", + "Event", + "EventM", + "Events", + "EvKey", + "EvResize", + "except", + "Except", + "Exception", + "ExceptT", + "execParser", + "execState", + "execStateT", + "Exit", + "exitFailure", + "exp", + "Exp", + "explicitParseField", + "explicitParseFieldMaybe", + "Exponent", + "Export", + "ExpQ", + "Expr", + "Extensions", + "extensionsFromList", + "Extent", + "extentSize", + "Ext_pipe_tables", + "extQ", + "Extra", + "Extras", + "fail", + "Fail", + "Failure", + "Fallible", + "False", + "FancyError", + "fg", + "fieldLabelModifier", + "FileBrowser", + "fileBrowserException", + "fileBrowserIsSearching", + "fileBrowserSelection", + "fileExtensionMatch", + "fileInfoFilePath", + "FilePath", + "Filesystem", + "FillIndent", + "fillStrategy", + "filter", + "filterM", + "filterWithKey", + "find", + "findAll", + "findIndex", + "findIndexL", + "findIndexR", + "findM", + "findWithDefault", + "FiniteBits", + "finiteBitSize", + "first", + "FirstContentType", + "firstJustM", + "Fix", + "Fixed", + "Fixedpoint", + "flag", + "flag'", + "flatAlt", + "flattenSCCs", + "flip", + "float", + "Float", + "floor", + "flushDiagnosticsBySource", + "fmap", + "Focus", + "focusedFormInputAttr", + "focusGetCurrent", + "focusNext", + "focusPrev", + "focusRing", + "FocusRing", + "focusSetCurrent", + "fold", + "Fold", + "Foldable", + "foldl", + "foldl'", + "foldM", + "foldMap", + "foldr", + "foldr1", + "foldrM", + "foldrWithKey", + "for_", + "forceAttr", + "forever", + "forkIO", + "forM", + "forM_", + "Format", + "formatScientific", + "formatTime", + "Forms", + "FPFormat", + "Fractional", + "freeVar", + "freeze", + "from", + "From", + "fromEnum", + "FromHttpApiData", + "fromInteger", + "fromIntegral", + "FromJSON", + "fromJSONKey", + "FromJSONKey", + "fromList", + "fromListWith", + "fromMapText", + "fromMaybe", + "fromNanoSecs", + "fromRight'", + "fromStrict", + "fromString", + "fromText", + "fst", + "FullColor", + "fullDesc", + "Function", + "Functor", + "Fuzzy", + "Fwd", + "generateImage", + "generateSignatures", + "Generic", + "Generic1", + "genericFromJSONKey", + "GenericList", + "genericParseJSON", + "Generics", + "genericToEncoding", + "genericToJSON", + "genericToJSONKey", + "get", + "Get", + "getContents", + "getContext", + "getEditContents", + "getEnv", + "getFreeVars", + "getLast", + "getName", + "getOffset", + "gets", + "Getter", + "getTime", + "getVirtualFile", + "getVtyHandle", + "getXdgDirectory", + "getZonedTime", + "GHC", + "giBranch", + "giHash", + "GitHash", + "GitInfo", + "gmapM", + "Graph", + "graphFromEdges", + "Graphics", + "Greedy", + "green", + "group", + "groupAllWith", + "GT", + "guard", + "halt", + "handleDialogEvent", + "handleEditorEvent", + "handleFileBrowserEvent", + "handleListEvent", + "Handler", + "Handlers", + "hardline", + "Has", + "HasAttributes", + "hash", + "Hash", + "Hashable", + "HashSet", + "hashWithSalt", + "Haskell", + "hBorder", + "hBorderWithLabel", + "hBox", + "hCenter", + "_head", + "head", + "header", + "Header", + "heading", + "help", + "helper", + "hexadecimal", + "hLimit", + "hLimitPercent", + "Hover", + "HoverContents", + "hPrint", + "hPutStrLn", + "hsep", + "hSize", + "Html", + "HTTP", + "HttpApiData", + "HttpException", + "httpLbs", + "hUserAgent", + "IArray", + "id", + "Identity", + "image", + "Image", + "imageHeight", + "imageL", + "imageWidth", + "imap", + "indefiniteDet", + "indent", + "index", + "Index", + "Indexed", + "InfixL", + "InfixN", + "InfixR", + "info", + "init", + "initialPos", + "initialPosState", + "initialState", + "Inlines", + "Input", + "InR", + "inRange", + "insert", + "insertWith", + "Instances", + "int", + "Int", + "Int32", + "Int64", + "IntBindingT", + "Integer", + "Integral", + "intercalate", + "Internal", + "Internals", + "interpretHandler", + "intersection", + "intersperse", + "IntMap", + "into", + "IntSet", + "IntVar", + "invalidateCache", + "invalidateCacheEntry", + "invalidFormInputAttr", + "IO", + "IOException", + "IORef", + "is", + "isAlphaNum", + "IsBlock", + "isDigit", + "isInfixOf", + "IsInline", + "isJust", + "IsList", + "isNothing", + "Iso", + "isPrefixOf", + "isRight", + "isSpace", + "IsString", + "isSubsetOf", + "italic", + "Item", + "iterate", + "itraverse", + "ix", + "Ix", + "Ixed", + "IxValue", + "join", + "joinableBorder", + "joinBorders", + "joinPath", + "JSON", + "JSONKeyOptions", + "_Just", + "Just", + "KBackTab", + "KBS", + "KChar", + "KDel", + "KDown", + "KEnd", + "KEnter", + "KEsc", + "Key", + "KeyMap", + "keyModifier", + "keys", + "keysSet", + "KeyValue", + "KFun", + "KHome", + "KLeft", + "Kolor", + "KPageDown", + "KPageUp", + "KRight", + "KUp", + "L", + "label", + "Language", + "_last", + "last", + "Last", + "LayoutOptions", + "layoutPretty", + "Lazy", + "lbrace", + "left", + "Left", + "lefts", + "leftSection", + "length", + "lengthAsPosition", + "lens", + "Lens", + "Lens'", + "lensField", + "LensLike", + "LensLike'", + "lensRules", + "letterChar", + "lexeme", + "Lexer", + "Lib", + "lift", + "Lift", + "liftA2", + "LiftC", + "liftEither", + "liftIO", + "line", + "line'", + "Linear", + "linearColor", + "lineBreak", + "lines", + "Lines", + "link", + "list", + "List", + "listArray", + "listDirectory", + "listElements", + "listFindBy", + "listMoveDown", + "listMoveTo", + "listMoveToElement", + "listReplace", + "listSelected", + "listSelectedElement", + "listSelectedElementL", + "listSelectedFocusedAttr", + "listSelectedL", + "listSkip", + "listToMaybe", + "ListUtils", + "local", + "Locale", + "LocalTime", + "location", + "Location", + "loc_filename", + "loc_start", + "log", + "long", + "Look", + "lookAhead", + "lookup", + "lookupExtent", + "lookupMin", + "lparen", + "LSP", + "LspM", + "LT", + "luminance", + "M1", + "magenta", + "Main", + "makeExprParser", + "makeLenses", + "makeLensesWith", + "makeStateMachine", + "MAlt", + "Manager", + "many", + "manyTill", + "map", + "Map", + "mapKeys", + "mapM", + "mapM_", + "mapMaybe", + "mapMaybeM", + "mapped", + "mappend", + "mapReaderT", + "mapWithKey", + "Markdown", + "markdownWith", + "MarkupContent", + "match", + "max", + "Max", + "maxBound", + "maximum", + "maximumBy", + "maximumOf", + "maybe", + "Maybe", + "maybeReader", + "MaybeT", + "maybeToEither", + "maybeToList", + "mconcat", + "MCtrl", + "Megaparsec", + "member", + "mempty", + "merge", + "Message", + "metavar", + "Method", + "Metric", + "mfix", + "Micro", + "min", + "Min", + "minBound", + "Minimorph", + "mismatchFailure", + "mkM", + "MkMarkdown", + "mkName", + "mkPos", + "mkStdGen", + "mkVty", + "MMeta", + "mod", + "Modifier", + "modify", + "modifyDefAttr", + "Monad", + "MonadError", + "MonadFail", + "MonadFix", + "MonadIO", + "MonadParsec", + "MonadPlus", + "MonadReader", + "MonadState", + "MonadTrans", + "Monoid", + "Monotonic", + "Most", + "Mouse", + "MouseDown", + "MouseUp", + "Move", + "moveCursor", + "mplus", + "MShift", + "msum", + "Mtl", + "Murmur", + "murmur3", + "MVar", + "mzero", + "Name", + "Named", + "NaturalSort", + "negate", + "negated", + "Negative", + "NEMap", + "nest", + "nestEventM'", + "Network", + "newBChan", + "newEmptyMVar", + "newFileBrowser", + "newIORef", + "newManager", + "NLP", + "NoColor", + "node", + "Node", + "NodeId", + "Noise", + "noiseValue", + "NominalDiffTime", + "NoMove", + "non", + "nonEmpty", + "NonEmpty", + "nonEmptyMap", + "norm", + "NormalizedUri", + "noSamples", + "not", + "notElem", + "notFollowedBy", + "Nothing", + "notificationHandler", + "notMember", + "nub", + "nubOrd", + "null", + "Null", + "Num", + "Number", + "Numeric", + "object", + "Object", + "ObjectWithSingleField", + "occursFailure", + "octal", + "ok200", + "OldList", + "on", + "onConfigurationChange", + "One", + "oneOf", + "OnRight", + "Operator", + "option", + "optional", + "options", + "Options", + "or", + "ord", + "Ord", + "Ordering", + "origin", + "otherwise", + "Output", + "outputColorMode", + "outputIface", + "over", + "Over", + "overrideAttr", + "P", + "pack", + "Pad", + "padAll", + "padBottom", + "padLeft", + "padLeftRight", + "padRight", + "padTop", + "padTopBottom", + "Page", + "Palette", + "Pandoc", + "PandocPure", + "para", + "paragraph", + "params", + "parse", + "Parse", + "Parsec", + "parseEither", + "ParseErrorBundle", + "parseErrorTextPretty", + "ParseException", + "parseJSON", + "Parser", + "ParserCombinators", + "parseRequest", + "ParserInfo", + "parseUrlPiece", + "parseVersion", + "partition", + "partitionBySource", + "partitionEithers", + "parts", + "pathSeparator", + "perlin", + "Perlin", + "perp", + "pi", + "Picture", + "pIndex", + "PixelRGBA8", + "plain", + "PlainText", + "plate", + "Plated", + "pLength", + "Png", + "Point", + "Port", + "Pos", + "position", + "Position", + "Positive", + "Posix", + "PosState", + "Post", + "Postfix", + "Prefix", + "preserveIndentation", + "pretty", + "Pretty", + "Prettyprinter", + "prettyPrintParseException", + "preuse", + "preview", + "Prim", + "print", + "printf", + "Printf", + "prism", + "Prism", + "Prism'", + "Profunctor", + "progDesc", + "Proxy", + "pstateInput", + "pstateLinePrefix", + "pstateOffset", + "pstateSourcePos", + "pstateTabWidth", + "publishDiagnostics", + "punctuate", + "pure", + "Pure", + "put", + "putMVar", + "putStr", + "putStrLn", + "pVal", + "Q", + "QuasiQuoter", + "query", + "Quote", + "quoteDec", + "quoteExp", + "quotePat", + "quoteType", + "R", + "Random", + "randomRIO", + "range", + "Range", + "Rangeable", + "ranged", + "Raw", + "rawAttributeSpec", + "rawBlock", + "rawInline", + "rbrace", + "RdYlGn", + "reachable", + "reachOffset", + "read", + "Read", + "readEither", + "Reader", + "Readers", + "ReaderT", + "readFile", + "readIORef", + "readMarkdown", + "readMaybe", + "ReadP", + "ReadPrec", + "readP_to_S", + "Real", + "RealFloat", + "RealFrac", + "realToFrac", + "red", + "referenceLinkDefinition", + "Refl", + "render", + "Render", + "renderCurlBasePath", + "renderDialog", + "renderEditor", + "renderError", + "renderFileBrowser", + "renderHtml", + "renderList", + "renderListWithIndex", + "renderStrict", + "renderString", + "renderTable", + "renderVScrollbar", + "renderVScrollbarTrough", + "Rep", + "repeat", + "replace", + "replicate", + "reportExtent", + "ReqBody", + "Request", + "requestExamples", + "requestHandler", + "requestHeaders", + "Response", + "responseBody", + "responseExamples", + "responseLBS", + "restrictKeys", + "return", + "reverse", + "reverseVideo", + "Rewrapped", + "RGB", + "rgbColor", + "RGBColor", + "Right", + "rights", + "rightSection", + "ringTerminalBell", + "Rope", + "round", + "rowBorders", + "rparen", + "run", + "Run", + "runError", + "runExceptT", + "runIdentity", + "runLspT", + "runM", + "runMaybeT", + "runParser", + "runParser'", + "runPure", + "runReader", + "runReaderT", + "runServer", + "runSettings", + "runState", + "runThrow", + "safeWcwidth", + "same", + "samples", + "satisfy", + "SaveOptions", + "SCC", + "Scientific", + "sconcat", + "scrollbarWidthAllocation", + "Searchable", + "second", + "selectNonDirectories", + "Semigroup", + "send", + "sendIO", + "sep", + "separateBorders", + "sepBy", + "sepBy1", + "sepEndBy1", + "Seq", + "Sequence", + "sequenceA", + "Servant", + "serve", + "serveDirectoryWith", + "Server", + "ServerDefinition", + "Set", + "Set3", + "setBeforeMainLoop", + "setDefaultColAlignment", + "setFileBrowserEntryFilter", + "setMode", + "setOf", + "setPort", + "Setter", + "Settings", + "setTitle", + "SHA", + "sha1", + "shiftL", + "shiftR", + "short", + "show", + "Show", + "showDigest", + "showDot", + "showFFloat", + "showFirstCursor", + "showVersion", + "Signed", + "simpleTable", + "singleSample", + "singleton", + "Singletons", + "SInitialized", + "size", + "Size", + "Skip", + "skipBlockComment", + "skipLineComment", + "snd", + "snoc", + "softBreak", + "softline", + "some", + "sort", + "sortBy", + "Sorting", + "sortKey", + "sortOn", + "sortWith", + "sourceColumn", + "sourceLine", + "SourcePos", + "Sources", + "space", + "space1", + "split", + "Split", + "splitAt", + "splitAtPosition", + "splitDirectories", + "splitExtension", + "splitFileName", + "splitMember", + "splitOn", + "splitPath", + "Splittable", + "squotes", + "SRGB", + "sRGB24", + "sRGB24read", + "sRGB24show", + "ssIndices", + "standout", + "state", + "State", + "StateC", + "StateMachine", + "statePosState", + "StaticFiles", + "staticHandlers", + "Status", + "stderr", + "StdGen", + "StdHandles", + "STextDocumentDidChange", + "STextDocumentDidOpen", + "STextDocumentDidSave", + "STextDocumentHover", + "Storage", + "str", + "strArgument", + "Stream", + "Strict", + "strikethrough", + "string", + "string'", + "String", + "strip", + "stripPrefix", + "strong", + "stronglyConnComp", + "strOption", + "Style", + "Sub", + "subparser", + "subtract", + "succ", + "Success", + "sum", + "Sum", + "sumEncoding", + "SumEncoding", + "supportsMode", + "surroundingBorder", + "swap", + "switch", + "symbol", + "Symbols", + "Sync", + "Syntax", + "System", + "table", + "Table", + "Tagged", + "tail", + "tails", + "take", + "takeBaseName", + "takeDirectory", + "takeExtension", + "takeExtensions", + "takeFileName", + "takeMVar", + "takeWhile", + "takeWhileEnd", + "takeWhileR", + "TdSyncFull", + "Terminal", + "test", + "testEquality", + "TestEquality", + "text", + "Text", + "textDocument", + "TextDocument", + "textDocumentSync", + "TextDocumentSyncOptions", + "TextDocumentVersion", + "Textual", + "tGitInfoCwdTry", + "TH", + "thematicBreak", + "thread", + "threadDelay", + "Throw", + "ThrowC", + "throwError", + "throwIO", + "Time", + "timeout", + "Timeout", + "TimeSpec", + "TLS", + "tlsManagerSettings", + "to", + "toCapture", + "ToCapture", + "toDescList", + "toEncoding", + "toEnum", + "toJSON", + "ToJSON", + "toJSONKey", + "ToJSONKey", + "toList", + "toLower", + "toMapText", + "toNanoSecs", + "toNormalizedUri", + "ToSample", + "toSamples", + "toSRGB24", + "toTitle", + "toUpper", + "Trans", + "transform", + "transpose", + "Traversable", + "Traversal", + "Traversal'", + "traverse", + "traverse_", + "traversed", + "Tree", + "TrivialError", + "True", + "try", + "Tuple", + "tupled", + "txt", + "txtWrap", + "txtWrapWith", + "Type", + "Typeable", + "Types", + "UArray", + "unangle", + "Unbounded", + "uncons", + "uncurry", + "undefined", + "underline", + "unFix", + "unfoldr", + "unfreeze", + "Unicode", + "Unifiable", + "Unification", + "uniformR", + "UniformRange", + "unify", + "union", + "unions", + "unionsWith", + "unionWith", + "uniplate", + "universe", + "unless", + "Unlift", + "unlines", + "unpack", + "unPos", + "Unsafe", + "unsafeIndex", + "unsafeToPiece", + "unTagged", + "UntaggedValue", + "unwords", + "unzip", + "Up", + "update", + "uri", + "Uri", + "use", + "uses", + "UTCDiff", + "UTCTime", + "UTerm", + "Utf16", + "UTF_8", + "Util", + "Utility", + "UVar", + "V2", + "Validation", + "validationToEither", + "value", + "Value", + "varE", + "VarE", + "vBorder", + "vBox", + "vcat", + "Vector", + "Verbs", + "Version", + "Vertical", + "verticalScrollbarRenderer", + "VFS", + "view", + "viewport", + "viewportScroll", + "ViewportScroll", + "viewr", + "VirtualFile", + "virtualFileText", + "visible", + "vLimit", + "vLimitPercent", + "void", + "Void", + "VScrollbarRenderer", + "vScrollBy", + "vScrollPage", + "vScrollToBeginning", + "vScrollToEnd", + "vsep", + "vSize", + "Vty", + "VtyEvent", + "Wai", + "WaiAppStatic", + "Walk", + "Warp", + "Web", + "when", + "whenJust", + "white", + "Widget", + "Widgets", + "Width", + "Window", + "Witch", + "withArray", + "withAttr", + "withBackColor", + "withDefAttr", + "wither", + "Witherable", + "withFocusRing", + "withForeColor", + "WithIndex", + "withObject", + "withoutKeys", + "withReaderT", + "withStyle", + "withText", + "withVScrollBarRenderer", + "withVScrollBars", + "Word", + "Word32", + "Word8", + "words", + "Wrap", + "_Wrapped", + "Wrapped", + "WrapSettings", + "writeBChan", + "writeFile", + "writeIORef", + "writeMarkdown", + "writePng", + "writerExtensions", + "Writers", + "XdgData", + "XdgDirectory", + "xor", + "Yaml", + "yellow", + "zero", + "zip", + "zipFrom", + "zipMatch", + "Zipper", + "zipWith", + "zipWithM", + "zipWithM_", + "zipWithMatched", + "ZonedTime", + "zonedTimeToUTC", + "zoom" + ] +} diff --git a/scripts/reformat-code.sh b/scripts/reformat-code.sh index e6ad9e90..c4cc8e7e 100755 --- a/scripts/reformat-code.sh +++ b/scripts/reformat-code.sh @@ -3,4 +3,4 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd $SCRIPT_DIR/.. -fourmolu --mode=inplace src app test \ No newline at end of file +fourmolu --mode=inplace src app test scripts \ No newline at end of file diff --git a/scripts/spellcheck/autopopulate-spellchecker.sh b/scripts/spellcheck/autopopulate-spellchecker.sh new file mode 100755 index 00000000..3e06b683 --- /dev/null +++ b/scripts/spellcheck/autopopulate-spellchecker.sh @@ -0,0 +1,45 @@ +#!/bin/bash -e + +# This script lives 2 levels deep in the directory structure. +# Ensure its commands get run at the toplevel. +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd $SCRIPT_DIR/../.. + + +# First, install hiedb: +# +# cabal install hiedb +# +# Then, generate *.hie files: +# +# cp hie.yaml.stack hie.yaml +# stack build --fast + +DBNAME=hie.sqlite +hiedb --database $DBNAME index .hie + +WORDS_TMPFILE_UNSORTED=$(mktemp --suffix .words) + +# First, get all variable names that originate from external packages. +# Exclude names that contain symbols other than underscore or apostrophe or do not contain any letters. +sqlite3 $DBNAME "SELECT substr(sym, 3) FROM (SELECT DISTINCT occ AS sym FROM refs WHERE unit NOT IN (SELECT DISTINCT unit FROM mods)) ORDER BY sym" | grep -v "[^[:alnum:]_']" | grep "[[:alpha:]]" > $WORDS_TMPFILE_UNSORTED + +# Next, append the individual "conids" extracted from all "modids" that originate from external packages. +# See definition of "conid" and "monid" here: +# https://www.haskell.org/onlinereport/haskell2010/haskellch5.html +sqlite3 $DBNAME "SELECT DISTINCT mod FROM refs WHERE unit NOT IN (SELECT DISTINCT unit FROM mods)" | scripts/spellcheck/split-module-names.hs >> $WORDS_TMPFILE_UNSORTED + +WORDS_TMPFILE=$(mktemp --suffix .words) +sort -u $WORDS_TMPFILE_UNSORTED > $WORDS_TMPFILE +rm $WORDS_TMPFILE_UNSORTED + +CSPELL_TMPFILE=$(mktemp --suffix .cspell) +CSPELL_FILEPATH=cspell.json + +# Now, stuff the sorted list of names into the cspell JSON file word list. +jq '.words = $newWords' --slurpfile newWords <(jq --raw-input --null-input 'inputs' $WORDS_TMPFILE) $CSPELL_FILEPATH > $CSPELL_TMPFILE + +# Overwrite the original with the modified version. +mv $CSPELL_TMPFILE $CSPELL_FILEPATH + +rm $WORDS_TMPFILE diff --git a/scripts/spellcheck/split-module-names.hs b/scripts/spellcheck/split-module-names.hs new file mode 100755 index 00000000..213c8f28 --- /dev/null +++ b/scripts/spellcheck/split-module-names.hs @@ -0,0 +1,28 @@ +#!/usr/bin/env stack +{- stack script --resolver lts-21.25 + --package data-ordlist + --package split +-} + +import Data.List.Ordered (nubSort) +import Data.List.Split (splitOn) + +-- | +-- Extracts all "conids" from a list of "modids". +-- (see definitions here: https://www.haskell.org/onlinereport/haskell2010/haskellch5.html ) +-- +-- E.g., takes lines of the following form: +-- +-- Data.Text +-- Control.Arrow +-- +-- and produces a flattened list of words: +-- +-- Arrow +-- Control +-- Data +-- Text +splitParts = unlines . nubSort . concatMap (splitOn ".") . lines + +main :: IO () +main = interact splitParts