From 7a6d2cc7435607a314cd4b10210e5f987d0a3466 Mon Sep 17 00:00:00 2001 From: Vivasvan Patel Date: Wed, 24 Apr 2024 14:00:55 +0530 Subject: [PATCH] camelCase done --- .../main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala | 6 +++--- zio-cli/jvm/src/test/scala/zio/cli/FileBasedArgs.scala | 4 ++-- .../main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zio-cli/jvm/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala b/zio-cli/jvm/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala index f8de8c3d..3304b95e 100644 --- a/zio-cli/jvm/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala +++ b/zio-cli/jvm/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala @@ -23,9 +23,9 @@ object ConfigFileArgsPlatformSpecific extends ConfigFilePlatformSpecific { // Use ZIO to filter the paths for { - do_path_exist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename)))) - existing_paths = do_path_exist.zip(pathsToCheck).collect { case (exists, path) if exists => path } - } yield existing_paths.distinct // Use distinct to remove duplicates at the end + doPathExist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename)))) + existingPaths = doPathExist.zip(pathsToCheck).collect { case (exists, path) if exists => path } + } yield existingPaths.distinct // Use distinct to remove duplicates at the end } def loadOptionsFromConfigFiles(topLevelCommand: String): ZIO[Any, IOException, List[String]] = diff --git a/zio-cli/jvm/src/test/scala/zio/cli/FileBasedArgs.scala b/zio-cli/jvm/src/test/scala/zio/cli/FileBasedArgs.scala index 301c2d25..073f9d51 100644 --- a/zio-cli/jvm/src/test/scala/zio/cli/FileBasedArgs.scala +++ b/zio-cli/jvm/src/test/scala/zio/cli/FileBasedArgs.scala @@ -20,11 +20,11 @@ object FileBasedArgs extends ZIOSpecDefault { _ <- createSampleConfigFiles(cwd, homeDir, command) // Check if the func checkAndGetOptionsFilePaths can - config_args <- configFileOps.loadOptionsFromConfigFiles(command) + configArgs <- configFileOps.loadOptionsFromConfigFiles(command) _ <- cleanUpSampleConfigFiles(cwd: Path, homeDir: Path, command) - } yield assert(config_args)(hasSameElements(List("home=true", "dir=true", "home=false"))) + } yield assert(configArgs)(hasSameElements(List("home=true", "dir=true", "home=false"))) }, test("should return directory ~/home and ./ which have .testApp config file for loading the args") { for { diff --git a/zio-cli/native/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala b/zio-cli/native/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala index f8de8c3d..03efdf09 100644 --- a/zio-cli/native/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala +++ b/zio-cli/native/src/main/scala/zio/cli/ConfigFileArgsPlatformSpecific.scala @@ -23,9 +23,9 @@ object ConfigFileArgsPlatformSpecific extends ConfigFilePlatformSpecific { // Use ZIO to filter the paths for { - do_path_exist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename)))) - existing_paths = do_path_exist.zip(pathsToCheck).collect { case (exists, path) if exists => path } - } yield existing_paths.distinct // Use distinct to remove duplicates at the end + doPathExist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename)))) + existingPaths = doPathExist.zip(pathsToCheck).collect { case (exists, path) if exists => path } + } yield existingPaths.distinct // Use distinct to remove duplicates at the end } def loadOptionsFromConfigFiles(topLevelCommand: String): ZIO[Any, IOException, List[String]] =