Swift extractor: Generalize SwiftDiagnostics

This commit is contained in:
Calum Grant
2024-01-15 09:12:26 +00:00
parent 8b464fbc4a
commit f82c29ee37
6 changed files with 67 additions and 58 deletions

View File

@@ -8,11 +8,10 @@
#include "swift/logging/SwiftLogging.h"
#include "swift/swift-autobuilder/CustomizingBuildLink.h"
constexpr codeql::SwiftDiagnostic buildCommandFailed{
.id = "build-command-failed",
.name = "Detected build command failed",
.action = "Set up a [manual build command][1] or [check the logs of the autobuild step][2].\n"
"\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK "\n[2]: " CHECK_LOGS_HELP_LINK};
constexpr codeql::Diagnostic buildCommandFailed = codeql::swiftDiagnostic(
"build-command-failed", "Detected build command failed",
"Set up a [manual build command][1] or [check the logs of the autobuild step][2].\n"
"\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK "\n[2]: " CHECK_LOGS_HELP_LINK);
static codeql::Logger& logger() {
static codeql::Logger ret{"build"};

View File

@@ -13,16 +13,16 @@ static constexpr std::string_view unknownType = "<unknown_target_type>";
const std::string_view codeql::programName = "autobuilder";
constexpr codeql::SwiftDiagnostic noProjectFound{
.id = "no-project-found",
.name = "No Xcode project or workspace found",
.action = "Set up a [manual build command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK};
constexpr codeql::Diagnostic noProjectFound = codeql::swiftDiagnostic(
"no-project-found",
"No Xcode project or workspace found",
"Set up a [manual build command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK);
constexpr codeql::SwiftDiagnostic noSwiftTarget{
.id = "no-swift-target",
.name = "No Swift compilation target found",
.action = "To analyze a custom set of source files, set up a [manual build "
"command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK};
constexpr codeql::Diagnostic noSwiftTarget = codeql::swiftDiagnostic(
"no-swift-target",
"No Swift compilation target found",
"To analyze a custom set of source files, set up a [manual build "
"command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK);
static codeql::Logger& logger() {
static codeql::Logger ret{"main"};