From 62ca4c6680a9cef7f8bcc0419b9f3ba5c5940328 Mon Sep 17 00:00:00 2001 From: Alexey Volokhov Date: Thu, 7 Dec 2023 21:27:14 +0300 Subject: [PATCH] [slang-tidy] fix slang-tidy's config-file option --- tools/tidy/src/tidy.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/tidy/src/tidy.cpp b/tools/tidy/src/tidy.cpp index 69f40eec1..5568ab1fa 100644 --- a/tools/tidy/src/tidy.cpp +++ b/tools/tidy/src/tidy.cpp @@ -70,10 +70,15 @@ int main(int argc, char** argv) { // Create the config class and populate it with the config file if provided TidyConfig tidyConfig; if (tidyConfigFile) { - if (!exists(std::filesystem::path(tidyConfigFile.value()))) + if (!exists(std::filesystem::path(tidyConfigFile.value()))) { slang::OS::printE(fmt::format("the path provided for the config file does not exist {}", tidyConfigFile.value())); - tidyConfig = TidyConfigParser(tidyConfigFile.value()).getConfig(); + tidyConfig = TidyConfigParser(tidyConfigFile.value()).getConfig(); + } + else { + tidyConfig = + TidyConfigParser(std::filesystem::path(tidyConfigFile.value())).getConfig(); + } } else if (auto path = project_slang_tidy_config()) { tidyConfig = TidyConfigParser(path.value()).getConfig();