Skip to content

Commit

Permalink
[slang-tidy] fix slang-tidy's config-file option
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyvoh committed Dec 8, 2023
1 parent 52ee547 commit 62ca4c6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/tidy/src/tidy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 62ca4c6

Please sign in to comment.