Skip to content

Commit 42d4090

Browse files
committed
Swift: reword TSP diagnostics after doc team review
1 parent fc9fe13 commit 42d4090

File tree

14 files changed

+55
-59
lines changed

14 files changed

+55
-59
lines changed

swift/integration-tests/osx-only/autobuilder/failure/diagnostics.expected

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
3+
""
54
],
6-
"plaintextMessage": "The detected build command failed (tried /usr/bin/xcodebuild build -project <test-root-directory>/hello-failure.xcodeproj -target hello-failure CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO).\n\nSet up a manual build command.",
5+
"markdownMessage": "`autobuild` failed to run the detected build command:\n```\n/usr/bin/xcodebuild build -project <test-root-directory>/hello-failure.xcodeproj -target hello-failure CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO\n```\n\nSet up a [manual build command][1] or [check the logs of the autobuild step][2].\n\n[1]: https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language\n[2]: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/using-workflow-run-logs",
76
"severity": "error",
87
"source": {
98
"extractorName": "swift",

swift/integration-tests/osx-only/autobuilder/no-build-system/diagnostics.expected

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
3+
""
54
],
6-
"plaintextMessage": "No Xcode project or workspace was found.\n\nSet up a manual build command.",
5+
"markdownMessage": "`autobuild` could not detect an Xcode project or workspace.\n\nSet up a [manual build command][1].\n\n[1]: https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language",
76
"severity": "error",
87
"source": {
98
"extractorName": "swift",
109
"id": "swift/autobuilder/no-project-found",
11-
"name": "No Xcode project or workspace detected"
10+
"name": "No Xcode project or workspace found"
1211
},
1312
"visibility": {
1413
"cliSummaryTable": true,

swift/integration-tests/osx-only/autobuilder/no-swift-with-spm/diagnostics.expected

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
3+
""
54
],
6-
"plaintextMessage": "No viable Swift Xcode target was found but a Swift package was detected. Swift Package Manager builds are not yet supported by the autobuilder.\n\nSet up a manual build command.",
5+
"markdownMessage": "A Swift package was detected, but no viable Xcode target was found.\n\nSwift Package Manager builds are not currently supported by `autobuild`. Set up a [manual build command][1].\n\n[1]: https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language",
76
"severity": "error",
87
"source": {
98
"extractorName": "swift",
109
"id": "swift/autobuilder/spm-not-supported",
11-
"name": "Swift Package Manager build unsupported by autobuild"
10+
"name": "Swift Package Manager is not supported"
1211
},
1312
"visibility": {
1413
"cliSummaryTable": true,

swift/integration-tests/osx-only/autobuilder/no-swift/diagnostics.expected

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
3+
""
54
],
6-
"plaintextMessage": "All targets found within Xcode projects or workspaces either have no Swift sources or are tests.\n\nSet up a manual build command.",
5+
"markdownMessage": "All targets found within Xcode projects or workspaces either have no Swift sources or are tests.\n\nTo analyze a custom set of source files, set up a [manual build command][1].\n\n[1]: https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language",
76
"severity": "error",
87
"source": {
98
"extractorName": "swift",

swift/integration-tests/osx-only/autobuilder/no-xcode-with-spm/diagnostics.expected

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
3+
""
54
],
6-
"plaintextMessage": "No viable Swift Xcode target was found but a Swift package was detected. Swift Package Manager builds are not yet supported by the autobuilder.\n\nSet up a manual build command.",
5+
"markdownMessage": "A Swift package was detected, but no viable Xcode target was found.\n\nSwift Package Manager builds are not currently supported by `autobuild`. Set up a [manual build command][1].\n\n[1]: https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language",
76
"severity": "error",
87
"source": {
98
"extractorName": "swift",
109
"id": "swift/autobuilder/spm-not-supported",
11-
"name": "Swift Package Manager build unsupported by autobuild"
10+
"name": "Swift Package Manager is not supported"
1211
},
1312
"visibility": {
1413
"cliSummaryTable": true,

swift/integration-tests/osx-only/autobuilder/only-tests-with-spm/diagnostics.expected

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
3+
""
54
],
6-
"plaintextMessage": "No viable Swift Xcode target was found but a Swift package was detected. Swift Package Manager builds are not yet supported by the autobuilder.\n\nSet up a manual build command.",
5+
"markdownMessage": "A Swift package was detected, but no viable Xcode target was found.\n\nSwift Package Manager builds are not currently supported by `autobuild`. Set up a [manual build command][1].\n\n[1]: https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language",
76
"severity": "error",
87
"source": {
98
"extractorName": "swift",
109
"id": "swift/autobuilder/spm-not-supported",
11-
"name": "Swift Package Manager build unsupported by autobuild"
10+
"name": "Swift Package Manager is not supported"
1211
},
1312
"visibility": {
1413
"cliSummaryTable": true,

swift/integration-tests/osx-only/autobuilder/only-tests/diagnostics.expected

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
{
22
"helpLinks": [
3-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/customizing-code-scanning",
4-
"https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language"
3+
""
54
],
6-
"plaintextMessage": "All targets found within Xcode projects or workspaces either have no Swift sources or are tests.\n\nSet up a manual build command.",
5+
"markdownMessage": "All targets found within Xcode projects or workspaces either have no Swift sources or are tests.\n\nTo analyze a custom set of source files, set up a [manual build command][1].\n\n[1]: https://docs.github.com/en/enterprise-server/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-the-codeql-workflow-for-compiled-languages#adding-build-steps-for-a-compiled-language",
76
"severity": "error",
87
"source": {
98
"extractorName": "swift",

swift/logging/SwiftDiagnostics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ nlohmann::json SwiftDiagnostic::json(const std::chrono::system_clock::time_point
4242
{"severity", severityToString(severity)},
4343
{"helpLinks", std::vector<std::string_view>(absl::StrSplit(helpLinks, ' '))},
4444
{format == Format::markdown ? "markdownMessage" : "plaintextMessage",
45-
absl::StrCat(message, ".\n\n", action)},
45+
absl::StrCat(message, "\n\n", action)},
4646
{"timestamp", fmt::format("{:%FT%T%z}", timestamp)},
4747
};
4848
if (location) {

swift/logging/SwiftDiagnostics.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ struct SwiftDiagnostic {
9191

9292
// create a JSON diagnostics for this source with the given `timestamp` and `message`
9393
// Depending on format, either a plaintextMessage or markdownMessage is used that includes both
94-
// the message and the action to take. A dot '.' is appended to `message`. The id is used to
95-
// construct the source id in the form `swift/<prog name>/<id>`
94+
// the message and the action to take. The id is used to construct the source id in the form
95+
// `swift/<prog name>/<id>`
9696
nlohmann::json json(const std::chrono::system_clock::time_point& timestamp,
9797
std::string_view message) const;
9898

swift/tools/autobuilder-diagnostics/IncompatibleOs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ static codeql::Logger& logger() {
3232

3333
int main() {
3434
DIAGNOSE_ERROR(incompatibleOs,
35-
"Currently, `autobuild` for Swift analysis is only supported on macOS");
35+
"Currently, `autobuild` for Swift analysis is only supported on macOS.");
3636
return 1;
3737
}

0 commit comments

Comments
 (0)