Skip to content

Commit c12e0c2

Browse files
Apply suggestions from linter review
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d0c6e33 commit c12e0c2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/scitokens.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ std::atomic_int configurer::Configuration::m_next_update_delta{600};
1515
std::atomic_int configurer::Configuration::m_expiry_delta{4 * 24 * 3600};
1616

1717
// SciTokens cache home config
18-
std::shared_ptr<std::string> configurer::Configuration::m_cache_home = std::make_shared<std::string>("");
18+
std::shared_ptr<std::string> configurer::Configuration::m_cache_home =
19+
std::make_shared<std::string>("");
1920

2021
SciTokenKey scitoken_key_create(const char *key_id, const char *alg,
2122
const char *public_contents,

src/scitokens_internal.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1076,27 +1076,32 @@ configurer::Configuration::set_cache_home(const std::string dir_path) {
10761076
return std::make_pair(true, "");
10771077
}
10781078

1079-
std::vector<std::string> path_components = path_split(dir_path); // cleans any extraneous /'s
1079+
std::vector<std::string> path_components =
1080+
path_split(dir_path); // cleans any extraneous /'s
10801081
std::string cleaned_dir_path;
1081-
for (const auto &component : path_components) { // add the / back to the path components
1082+
for (const auto &component :
1083+
path_components) { // add the / back to the path components
10821084
cleaned_dir_path += "/" + component;
10831085
}
10841086

10851087
// Check that the cache_home exists, and if not try to create it
1086-
auto rp = mkdir_and_parents_if_needed(cleaned_dir_path); // Structured bindings not introduced until cpp 17
1087-
if (!rp.first) { //
1088-
std::string err_prefix{"An issue was encountered with the provided cache home path: "};
1088+
auto rp = mkdir_and_parents_if_needed(
1089+
cleaned_dir_path); // Structured bindings not introduced until cpp 17
1090+
if (!rp.first) { //
1091+
std::string err_prefix{
1092+
"An issue was encountered with the provided cache home path: "};
10891093
return std::make_pair(false, err_prefix + rp.second);
10901094
}
10911095

1092-
10931096
// Now it exists and we can write to it, set the value and let
10941097
// scitokens_cache handle the rest
10951098
m_cache_home = std::make_shared<std::string>(cleaned_dir_path);
10961099
return std::make_pair(true, "");
10971100
}
10981101

1099-
std::string configurer::Configuration::get_cache_home() { return *m_cache_home; }
1102+
std::string configurer::Configuration::get_cache_home() {
1103+
return *m_cache_home;
1104+
}
11001105

11011106
// bool configurer::Configuration::check_dir(const std::string dir_path) {
11021107
// struct stat info;

0 commit comments

Comments
 (0)