Skip to content

Commit a1beaa6

Browse files
authored
Merge pull request github#13186 from github/redsun82/swift-diagnostics-wording
Swift: reword TSP diagnostics after doc team review
2 parents 2206216 + 110b766 commit a1beaa6

File tree

15 files changed

+57
-60
lines changed

15 files changed

+57
-60
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```\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 contain no Swift source files, 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 contain no Swift source files, 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
@@ -93,8 +93,8 @@ struct SwiftDiagnostic {
9393

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

swift/logging/tests/assertion-diagnostics/AssertFalse.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ static codeql::Logger& logger() {
88
}
99

1010
int main() {
11-
CODEQL_ASSERT(false, "Format the int {} and string {} if this assertion fails", 1234, "myString");
11+
CODEQL_ASSERT(false, "Format the int {} and string {} if this assertion fails.", 1234,
12+
"myString");
1213
}

0 commit comments

Comments
 (0)