From e43ca29f202c768165fcecceb2bc5be0aef00df8 Mon Sep 17 00:00:00 2001 From: Fyodor Soikin Date: Sat, 8 Feb 2025 22:51:03 -0500 Subject: [PATCH] Autoformatter is an entity that formats itself --- core/src/Log.purs | 1 + .../index/src/Docs/Search/IndexBuilder.purs | 15 ++++++++------- src/Spago/Purs.purs | 13 +++++++------ 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/core/src/Log.purs b/core/src/Log.purs index 00222c2ab..7bb765838 100644 --- a/core/src/Log.purs +++ b/core/src/Log.purs @@ -76,6 +76,7 @@ data LogVerbosity = LogQuiet | LogNormal | LogVerbose + derive instance Eq LogVerbosity -- | LogVeryVerbose -- TODO:we'll need to add timestamps, and locations, see https://stackoverflow.com/questions/45395369/ diff --git a/docs-search/index/src/Docs/Search/IndexBuilder.purs b/docs-search/index/src/Docs/Search/IndexBuilder.purs index 0fd1c2de6..6eca91f15 100644 --- a/docs-search/index/src/Docs/Search/IndexBuilder.purs +++ b/docs-search/index/src/Docs/Search/IndexBuilder.purs @@ -108,11 +108,11 @@ run cfg@{ log } = do sequential $ parallel (writeIndex cfg index) - *> parallel (writeTypeIndex typeIndex) - *> parallel (writePackageInfo packageInfo) - *> parallel (writeModuleIndex moduleIndex) - *> parallel (patchDocs cfg) - *> parallel (copyAppFile cfg) + *> parallel (writeTypeIndex typeIndex) + *> parallel (writePackageInfo packageInfo) + *> parallel (writeModuleIndex moduleIndex) + *> parallel (patchDocs cfg) + *> parallel (copyAppFile cfg) let countOfDefinitions = Trie.size $ unwrap index @@ -365,8 +365,9 @@ createDirectories { generatedDocs, die } = do copyAppFile :: Config -> Aff Unit copyAppFile { generatedDocs, die } = do appFile <- liftEffect getDocsSearchAppPath - unlessM (fileExists appFile) $ - die $ + unlessM (fileExists appFile) + $ die + $ "Client-side app was not found at " <> appFile <> ".\n" <> "Check your installation." buffer <- readFile appFile diff --git a/src/Spago/Purs.purs b/src/Spago/Purs.purs index bf361eb77..0cc949db4 100644 --- a/src/Spago/Purs.purs +++ b/src/Spago/Purs.purs @@ -110,12 +110,13 @@ printDocsFormat = case _ of Ctags -> "ctags" Etags -> "etags" -docs :: ∀ a. - { root :: RootPath - , globs :: Set LocalPath - , format :: DocsFormat - , quiet :: Boolean - } +docs + :: ∀ a + . { root :: RootPath + , globs :: Set LocalPath + , format :: DocsFormat + , quiet :: Boolean + } -> Spago (PursEnv a) (Either ExecaResult ExecaResult) docs cfg = do { purs } <- ask