Skip to content

Commit 7cadb0a

Browse files
committed
Swift extractor: Simplify declarations back
1 parent f400a5f commit 7cadb0a

File tree

4 files changed

+25
-22
lines changed

4 files changed

+25
-22
lines changed

swift/logging/SwiftDiagnostics.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,15 @@ inline constexpr Diagnostic::Visibility operator&(Diagnostic::Visibility lhs,
9797
static_cast<unsigned char>(rhs));
9898
}
9999

100-
constexpr Diagnostic internalError = Diagnostic{
101-
.id="internal-error", .name="Internal error",
102-
.action="Some or all of the Swift analysis may have failed.\n"
103-
"\n"
104-
"If the error persists, contact support, quoting the error message and describing what "
105-
"happened, or [open an issue in our open source repository][1].\n"
106-
"\n"
107-
"[1]: https://github.com/github/codeql/issues/new?labels=bug&template=ql---general.md",
108-
.severity=Diagnostic::Severity::warning};
100+
constexpr Diagnostic internalError{
101+
.id = "internal-error",
102+
.name = "Internal error",
103+
.action =
104+
"Some or all of the Swift analysis may have failed.\n"
105+
"\n"
106+
"If the error persists, contact support, quoting the error message and describing what "
107+
"happened, or [open an issue in our open source repository][1].\n"
108+
"\n"
109+
"[1]: https://github.com/github/codeql/issues/new?labels=bug&template=ql---general.md",
110+
.severity = Diagnostic::Severity::warning};
109111
} // namespace codeql

swift/swift-autobuilder/BuildRunner.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
#include "swift/logging/SwiftLogging.h"
99
#include "swift/swift-autobuilder/CustomizingBuildLink.h"
1010

11-
constexpr codeql::Diagnostic buildCommandFailed = codeql::Diagnostic{
12-
.id="build-command-failed", .name="Detected build command failed",
13-
.action="Set up a [manual build command][1] or [check the logs of the autobuild step][2].\n"
14-
"\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK "\n[2]: " CHECK_LOGS_HELP_LINK};
11+
constexpr codeql::Diagnostic buildCommandFailed{
12+
.id = "build-command-failed",
13+
.name = "Detected build command failed",
14+
.action = "Set up a [manual build command][1] or [check the logs of the autobuild step][2].\n"
15+
"\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK "\n[2]: " CHECK_LOGS_HELP_LINK};
1516

1617
static codeql::Logger& logger() {
1718
static codeql::Logger ret{"build"};

swift/swift-autobuilder/swift-autobuilder.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ static constexpr std::string_view unknownType = "<unknown_target_type>";
1414
const std::string_view codeql::programName = "autobuilder";
1515
const std::string_view codeql::extractorName = "swift";
1616

17-
constexpr codeql::Diagnostic noProjectFound = codeql::Diagnostic{
18-
.id="no-project-found",
19-
.name="No Xcode project or workspace found",
20-
.action="Set up a [manual build command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK};
17+
constexpr codeql::Diagnostic noProjectFound{
18+
.id = "no-project-found",
19+
.name = "No Xcode project or workspace found",
20+
.action = "Set up a [manual build command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK};
2121

22-
constexpr codeql::Diagnostic noSwiftTarget = codeql::Diagnostic{
23-
.id="no-swift-target",
24-
.name="No Swift compilation target found",
25-
.action="To analyze a custom set of source files, set up a [manual build "
22+
constexpr codeql::Diagnostic noSwiftTarget{
23+
.id = "no-swift-target",
24+
.name = "No Swift compilation target found",
25+
.action = "To analyze a custom set of source files, set up a [manual build "
2626
"command][1].\n\n[1]: " MANUAL_BUILD_COMMAND_HELP_LINK};
2727

2828
static codeql::Logger& logger() {

swift/tools/diagnostics/AutobuilderIncompatibleOs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
const std::string_view codeql::programName = "autobuilder";
1010
const std::string_view codeql::extractorName = "swift";
1111

12-
constexpr codeql::Diagnostic incompatibleOs = codeql::Diagnostic{
12+
constexpr codeql::Diagnostic incompatibleOs{
1313
.id = "incompatible-os",
1414
.name = "Incompatible operating system (expected macOS)",
1515
.action =

0 commit comments

Comments
 (0)