Skip to content

Commit 71dfc73

Browse files
authored
Merge pull request #2042 from ahoppen/soundness-checks
Fix yaml lint error and remove offensive terms from the codebase
2 parents 42cc692 + 8aa8fa0 commit 71dfc73

File tree

12 files changed

+32
-32
lines changed

12 files changed

+32
-32
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# This source file is part of the Swift.org open source project
2-
#
3-
# Copyright (c) 2024 Apple Inc. and the Swift project authors
4-
# Licensed under Apache License v2.0 with Runtime Library Exception
5-
#
6-
# See https://swift.org/LICENSE.txt for license information
7-
# See https://swift.org/CONTRIBUTORS.txt for Swift project authors
2+
#
3+
# Copyright (c) 2024 Apple Inc. and the Swift project authors
4+
# Licensed under Apache License v2.0 with Runtime Library Exception
5+
#
6+
# See https://swift.org/LICENSE.txt for license information
7+
# See https://swift.org/CONTRIBUTORS.txt for Swift project authors
88

9-
contact_links:
10-
- name: Discussion Forum
11-
url: https://forums.swift.org/c/development/sourcekit-lsp
12-
about: Ask and answer questions about SourceKit-LSP
9+
contact_links:
10+
- name: Discussion Forum
11+
url: https://forums.swift.org/c/development/sourcekit-lsp
12+
about: Ask and answer questions about SourceKit-LSP

Documentation/Configuration File.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The structure of the file is currently not guaranteed to be stable. Options may
3838
- `clangdOptions: string[]`: Extra command line arguments passed to `clangd` when launching it.
3939
- `index`: Options related to indexing.
4040
- `indexPrefixMap: [string: string]`: Path remappings for remapping index data for local use.
41-
- `updateIndexStoreTimeout: integer`: Number of seconds to wait for an update index store task to finish before killing it.
41+
- `updateIndexStoreTimeout: integer`: Number of seconds to wait for an update index store task to finish before terminating it.
4242
- `logging`: Options related to logging, changing SourceKit-LSP’s logging behavior on non-Apple platforms. On Apple platforms, logging is done through the [system log](Diagnose%20Bundle.md#Enable%20Extended%20Logging). These options can only be set globally and not per workspace.
4343
- `level: "debug"|"info"|"default"|"error"|"fault"`: The level from which one onwards log messages should be written.
4444
- `privacyLevel: "public"|"private"|"sensitive"`: Whether potentially sensitive information should be redacted. Default is `public`, which redacts potentially sensitive information.

Sources/LanguageServerProtocol/SupportTypes/VersionedTextDocumentIdentifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public struct OptionalVersionedTextDocumentIdentifier: Hashable, Codable, Sendab
4242
/// identifier is sent from the server to the client and the file is not
4343
/// open in the editor (the server has not received an open notification
4444
/// before) the server can send `null` to indicate that the version is
45-
/// known and the content on disk is the master (as specified with document
45+
/// known and the content on disk is the primary (as specified with document
4646
/// content ownership).
4747
///
4848
/// The version number of a document will increase after each change,

Sources/SKLogging/SetGlobalLogFileHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private func isProcessAlive(pid: Int32) -> Bool {
144144
}
145145
return false
146146
#else
147-
return kill(pid, 0) == 0
147+
return kill(pid, 0) == 0 // ignore-unacceptable-language
148148
#endif
149149
}
150150

Sources/SKOptions/SourceKitLSPOptions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public struct SourceKitLSPOptions: Sendable, Codable, Equatable {
179179
///
180180
/// - Note: Internal option, may not work as intended
181181
public var maxCoresPercentageToUseForBackgroundIndexing: Double?
182-
/// Number of seconds to wait for an update index store task to finish before killing it.
182+
/// Number of seconds to wait for an update index store task to finish before terminating it.
183183
public var updateIndexStoreTimeout: Int?
184184

185185
public var maxCoresPercentageToUseForBackgroundIndexingOrDefault: Double {

Sources/SourceKitLSP/Clang/ClangLanguageService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,19 +318,19 @@ actor ClangLanguageService: LanguageService, MessageHandler {
318318
}
319319

320320
func crash() {
321-
// Since `clangd` doesn't have a method to crash it, kill it.
321+
// Since `clangd` doesn't have a method to crash it, terminate it.
322322
#if os(Windows)
323323
if self.hClangd != INVALID_HANDLE_VALUE {
324324
// We can potentially deadlock the process if a kobject is a pending state.
325325
// Unfortunately, the `OpenProcess(PROCESS_TERMINATE, ...)`, `CreateRemoteThread`, `ExitProcess` dance, while
326-
// safer, can also indefinitely hang as `CreateRemoteThread` may not be serviced depending on the state of
326+
// safer, can also indefinitely spin as `CreateRemoteThread` may not be serviced depending on the state of
327327
// the process. This just attempts to terminate the process, risking a deadlock and resource leaks, which is fine
328328
// since we only use `crash` from tests.
329329
_ = TerminateProcess(self.hClangd, 255)
330330
}
331331
#else
332332
if let pid = self.clangdPid {
333-
kill(pid, SIGKILL)
333+
kill(pid, SIGKILL) // ignore-unacceptable-language
334334
}
335335
#endif
336336
}

Sources/SourceKitLSP/Swift/SwiftLanguageService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ fileprivate extension Range {
5151
}
5252
}
5353

54-
/// Explicitly blacklisted `DocumentURI` schemes.
54+
/// Explicitly excluded `DocumentURI` schemes.
5555
fileprivate let excludedDocumentURISchemes: [String] = [
5656
"git",
5757
"hg",
5858
]
5959

6060
/// Returns true if diagnostics should be emitted for the given document.
6161
///
62-
/// Some editors (like Visual Studio Code) use non-file URLs to manage source control diff bases
62+
/// Some editors (like Visual Studio Code) use non-file URLs to manage source control diff bases
6363
/// for the active document, which can lead to duplicate diagnostics in the Problems view.
64-
/// As a workaround we explicitly blacklist those URIs and don't emit diagnostics for them.
64+
/// As a workaround we explicitly exclude those URIs and don't emit diagnostics for them.
6565
///
6666
/// Additionally, as of Xcode 11.4, sourcekitd does not properly handle non-file URLs when
6767
/// the `-working-directory` argument is passed since it incorrectly applies it to the input

Sources/TSCExtensions/Process+Run.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import Android
2828

2929
extension Process {
3030
/// Wait for the process to exit. If the task gets cancelled, during this time, send a `SIGINT` to the process.
31-
/// Should the process not terminate on SIGINT after 2 seconds, it is killed using `SIGKILL`.
31+
/// Should the process not terminate on SIGINT after 2 seconds, it is terminated using `SIGKILL`.
3232
@discardableResult
3333
package func waitUntilExitStoppingProcessOnTaskCancellation() async throws -> ProcessResult {
3434
let hasExited = AtomicBool(initialValue: false)
@@ -40,7 +40,7 @@ extension Process {
4040
} onCancel: {
4141
signal(SIGINT)
4242
Task {
43-
// Give the process 2 seconds to react to a SIGINT. If that doesn't work, kill the process.
43+
// Give the process 2 seconds to react to a SIGINT. If that doesn't work, terminate the process.
4444
try await Task.sleep(for: .seconds(2))
4545
if !hasExited.value {
4646
#if os(Windows)

Tests/SourceKitDTests/CrashRecoveryTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ final class CrashRecoveryTests: XCTestCase {
6363
// Wait for diagnostics to be produced to make sure the document open got handled by sourcekitd.
6464
_ = try await testClient.nextDiagnosticsNotification()
6565

66-
// Do a sanity check and verify that we get the expected result from a hover response before crashing sourcekitd.
66+
// Verify that we get the expected result from a hover response before crashing sourcekitd.
6767

6868
let hoverRequest = HoverRequest(textDocument: TextDocumentIdentifier(uri), position: positions["1️⃣"])
6969
let preCrashHoverResponse = try await testClient.send(hoverRequest)
7070
precondition(
7171
preCrashHoverResponse?.contains(string: "foo()") ?? false,
72-
"Sanity check failed. The Hover response did not contain foo(), even before crashing sourcekitd. Received response: \(String(describing: preCrashHoverResponse))"
72+
"Precondition test failed. The Hover response did not contain foo(), even before crashing sourcekitd. Received response: \(String(describing: preCrashHoverResponse))"
7373
)
7474

7575
testClient.handleSingleRequest { (request: CreateWorkDoneProgressRequest) -> VoidResponse in
@@ -170,7 +170,7 @@ final class CrashRecoveryTests: XCTestCase {
170170
)
171171
)
172172

173-
// Do a sanity check and verify that we get the expected result from a hover response before crashing clangd.
173+
// Verify that we get the expected result from a hover response before crashing clangd.
174174

175175
let expectedHoverRange = Position(line: 1, utf16index: 5)..<Position(line: 1, utf16index: 9)
176176

@@ -181,7 +181,7 @@ final class CrashRecoveryTests: XCTestCase {
181181
let preCrashHoverResponse = try await testClient.send(hoverRequest)
182182
precondition(
183183
preCrashHoverResponse?.range == expectedHoverRange,
184-
"Sanity check failed. The Hover response was not what we expected, even before crashing sourcekitd"
184+
"Precondition test failed. The Hover response was not what we expected, even before crashing sourcekitd"
185185
)
186186

187187
// Crash clangd
@@ -218,7 +218,7 @@ final class CrashRecoveryTests: XCTestCase {
218218

219219
let (mainUri, positions) = try project.openDocument("main.cpp")
220220

221-
// Do a sanity check and verify that we get the expected result from a hover response before crashing clangd.
221+
// Verify that we get the expected result from a hover response before crashing clangd.
222222

223223
let expectedHighlightResponse = [
224224
DocumentHighlight(range: positions["1️⃣"]..<positions["2️⃣"], kind: .text),
@@ -232,7 +232,7 @@ final class CrashRecoveryTests: XCTestCase {
232232
let preCrashHighlightResponse = try await project.testClient.send(highlightRequest)
233233
precondition(
234234
preCrashHighlightResponse == expectedHighlightResponse,
235-
"Sanity check failed. The Hover response was not what we expected, even before crashing sourcekitd"
235+
"Precondition test failed. The Hover response was not what we expected, even before crashing sourcekitd"
236236
)
237237

238238
// Crash clangd

Tests/SourceKitLSPTests/CompilationDatabaseTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ final class CompilationDatabaseTests: XCTestCase {
3939

4040
let (mainUri, positions) = try project.openDocument("main.cpp")
4141

42-
// Do a sanity check and verify that we get the expected result from a hover response before modifying the compile commands.
42+
// Verify that we get the expected result from a hover response before modifying the compile commands.
4343

4444
let highlightRequest = DocumentHighlightRequest(
4545
textDocument: TextDocumentIdentifier(mainUri),

Tests/SourceKitLSPTests/SwiftInterfaceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class SwiftInterfaceTests: XCTestCase {
3535
let location = try XCTUnwrap(resp?.locations?.only)
3636
XCTAssertTrue(location.uri.pseudoPath.hasSuffix("Foundation.swiftinterface"))
3737
let fileContents = try XCTUnwrap(location.uri.fileURL.flatMap({ try String(contentsOf: $0, encoding: .utf8) }))
38-
// Sanity-check that the generated Swift Interface contains Swift code
38+
// Smoke test that the generated Swift Interface contains Swift code
3939
XCTAssert(
4040
fileContents.hasPrefix("import "),
4141
"Expected that the foundation swift interface starts with 'import ' but got '\(fileContents.prefix(100))'"

config.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@
143143
"type" : "object"
144144
},
145145
"updateIndexStoreTimeout" : {
146-
"description" : "Number of seconds to wait for an update index store task to finish before killing it.",
147-
"markdownDescription" : "Number of seconds to wait for an update index store task to finish before killing it.",
146+
"description" : "Number of seconds to wait for an update index store task to finish before terminating it.",
147+
"markdownDescription" : "Number of seconds to wait for an update index store task to finish before terminating it.",
148148
"type" : "integer"
149149
}
150150
},

0 commit comments

Comments
 (0)