Cleanup: better naming and API logic

GitOrigin-RevId: e543a3a06c7817508b164acdf3df2c79b7841c31
This commit is contained in:
Andrey Lisin
2024-02-09 14:43:26 +00:00
committed by intellij-monorepo-bot
parent c83d01a78c
commit 798178da08
+5 -5
View File
@@ -111,7 +111,7 @@ public class PyEnvTaskRunner {
}
catch (final RuntimeException | Error ex) {
// Runtime and error are logged including environment info
LOG.warn(joinStrings(passedRoots, "Tests passed environments: ") +
LOG.warn(formatCollectionToString(passedRoots, "Tests passed environments") +
"Test failed on " +
getEnvType() +
" environment " +
@@ -137,9 +137,9 @@ public class PyEnvTaskRunner {
throw new RuntimeException("test " +
testName +
" was not executed.\n" +
joinStrings(myRoots, "All roots: ") +
formatCollectionToString(myRoots, "All roots") +
"\n" +
joinStrings(requiredTags, "Required tags in tags.txt in root: "));
formatCollectionToString(requiredTags, "Required tags in tags.txt in root"));
}
}
@@ -236,7 +236,7 @@ public class PyEnvTaskRunner {
}
@NotNull
private static String joinStrings(final Collection<String> roots, final String rootsName) {
return !roots.isEmpty() ? rootsName + StringUtil.join(roots, ", ") + "\n" : "";
private static String formatCollectionToString(Collection<String> coll, String collName) {
return !coll.isEmpty() ? collName + ": " + StringUtil.join(coll, ", ") + "\n" : "";
}
}