From e3969d5365fdf6a050033c5affa29122fb1f2fd8 Mon Sep 17 00:00:00 2001 From: Abdelrahman Abounegm Date: Sun, 10 Dec 2023 13:10:30 +0300 Subject: [PATCH 1/2] Throw an error when rzk.yaml `include` is empty --- rzk/src/Rzk/Main.hs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rzk/src/Rzk/Main.hs b/rzk/src/Rzk/Main.hs index cde9a45a9..83cd86095 100644 --- a/rzk/src/Rzk/Main.hs +++ b/rzk/src/Rzk/Main.hs @@ -5,12 +5,13 @@ module Rzk.Main where -import Control.Monad (forM, when) -import Data.List (sort) -import qualified Data.Yaml as Yaml -import System.Directory (doesPathExist) -import System.FilePath.Glob (glob) -import qualified Language.Rzk.Syntax as Rzk +import Control.Monad (forM, when) +import Data.List (sort) +import qualified Data.Yaml as Yaml +import System.Directory (doesPathExist) +import System.FilePath.Glob (glob) + +import qualified Language.Rzk.Syntax as Rzk import Rzk.Project.Config import Rzk.TypeCheck @@ -69,6 +70,7 @@ parseRzkFilesOrStdin = \case then do putStrLn ("Using Rzk project stucture specified in " <> rzkYamlPath) paths <- extractFilesFromRzkYaml rzkYamlPath + when (null paths) (error $ "No files found in " <> rzkYamlPath) parseRzkFilesOrStdin paths else do rzkModule <- parseStdin From c9b94dc1578837a9bc8233b2cd61db84cdca78ce Mon Sep 17 00:00:00 2001 From: Nikolai Kudasov Date: Mon, 11 Dec 2023 15:09:04 +0300 Subject: [PATCH 2/2] Update rzk/src/Rzk/Main.hs --- rzk/src/Rzk/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rzk/src/Rzk/Main.hs b/rzk/src/Rzk/Main.hs index 83cd86095..4faacc738 100644 --- a/rzk/src/Rzk/Main.hs +++ b/rzk/src/Rzk/Main.hs @@ -70,7 +70,7 @@ parseRzkFilesOrStdin = \case then do putStrLn ("Using Rzk project stucture specified in " <> rzkYamlPath) paths <- extractFilesFromRzkYaml rzkYamlPath - when (null paths) (error $ "No files found in " <> rzkYamlPath) + when (null paths) (error $ "No Rzk files specified in the config file at " <> rzkYamlPath) parseRzkFilesOrStdin paths else do rzkModule <- parseStdin