Skip to content

Commit 1256771

Browse files
authored
Merge pull request #134 from neonichu/remove-non-inclusive-language
Remove non-inclusive language
2 parents cf363a3 + 28ad1ed commit 1256771

File tree

5 files changed

+29
-29
lines changed

5 files changed

+29
-29
lines changed

Sources/TSCBasic/StringConversions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// - codeUnit: The code unit to be checked.
1515
///
1616
/// - Returns: True if shell escaping is not needed.
17-
private func inShellWhitelist(_ codeUnit: UInt8) -> Bool {
17+
private func inShellAllowlist(_ codeUnit: UInt8) -> Bool {
1818
#if os(Windows)
1919
if codeUnit == UInt8(ascii: "\\") {
2020
return true
@@ -49,8 +49,8 @@ extension String {
4949
/// - Returns: Shell escaped string.
5050
public func spm_shellEscaped() -> String {
5151

52-
// If all the characters in the string are in whitelist then no need to escape.
53-
guard let pos = utf8.firstIndex(where: { !inShellWhitelist($0) }) else {
52+
// If all the characters in the string are in the allow list then no need to escape.
53+
guard let pos = utf8.firstIndex(where: { !inShellAllowlist($0) }) else {
5454
return self
5555
}
5656

Sources/TSCTestSupport/PseudoTerminal.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,43 @@ import TSCLibc
1414
#if os(Windows)
1515
#else
1616
public final class PseudoTerminal {
17-
let master: Int32
18-
let slave: Int32
17+
let primary: Int32
18+
let secondary: Int32
1919
public var outStream: LocalFileOutputByteStream
2020

2121
public init?(){
22-
var master: Int32 = 0
23-
var slave: Int32 = 0
24-
if openpty(&master, &slave, nil, nil, nil) != 0 {
22+
var primary: Int32 = 0
23+
var secondary: Int32 = 0
24+
if openpty(&primary, &secondary, nil, nil, nil) != 0 {
2525
return nil
2626
}
27-
guard let outStream = try? LocalFileOutputByteStream(filePointer: fdopen(slave, "w"), closeOnDeinit: false) else {
27+
guard let outStream = try? LocalFileOutputByteStream(filePointer: fdopen(secondary, "w"), closeOnDeinit: false) else {
2828
return nil
2929
}
3030
self.outStream = outStream
31-
self.master = master
32-
self.slave = slave
31+
self.primary = primary
32+
self.secondary = secondary
3333
}
3434

35-
public func readMaster(maxChars n: Int = 1000) -> String? {
35+
public func readPrimary(maxChars n: Int = 1000) -> String? {
3636
var buf: [CChar] = [CChar](repeating: 0, count: n)
37-
if read(master, &buf, n) <= 0 {
37+
if read(primary, &buf, n) <= 0 {
3838
return nil
3939
}
4040
return String(cString: buf)
4141
}
4242

43-
public func closeSlave() {
44-
_ = TSCLibc.close(slave)
43+
public func closeSecondary() {
44+
_ = TSCLibc.close(secondary)
4545
}
4646

47-
public func closeMaster() {
48-
_ = TSCLibc.close(master)
47+
public func closePrimary() {
48+
_ = TSCLibc.close(primary)
4949
}
5050

5151
public func close() {
52-
closeSlave()
53-
closeMaster()
52+
closeSecondary()
53+
closePrimary()
5454
}
5555
}
5656
#endif

Sources/TSCUtility/PkgConfig.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import Foundation
1414
public enum PkgConfigError: Swift.Error, CustomStringConvertible {
1515
case couldNotFindConfigFile(name: String)
1616
case parsingError(String)
17-
case nonWhitelistedFlags(String)
17+
case prohibitedFlags(String)
1818

1919
public var description: String {
2020
switch self {
2121
case .couldNotFindConfigFile(let name):
2222
return "couldn't find pc file for \(name)"
2323
case .parsingError(let error):
2424
return "parsing error(s): \(error)"
25-
case .nonWhitelistedFlags(let flags):
26-
return "non whitelisted flag(s): \(flags)"
25+
case .prohibitedFlags(let flags):
26+
return "prohibited flag(s): \(flags)"
2727
}
2828
}
2929
}

Tests/TSCBasicTests/TerminalControllerTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ final class TerminalControllerTests: XCTestCase {
2323

2424
// Test red color.
2525
term.write("hello", inColor: .red)
26-
XCTAssertEqual(pty.readMaster(), "\u{1B}[31mhello\u{1B}[0m")
26+
XCTAssertEqual(pty.readPrimary(), "\u{1B}[31mhello\u{1B}[0m")
2727

2828
// Test clearLine.
2929
term.clearLine()
30-
XCTAssertEqual(pty.readMaster(), "\u{1B}[2K\r")
30+
XCTAssertEqual(pty.readPrimary(), "\u{1B}[2K\r")
3131

3232
// Test endline.
3333
term.endLine()
34-
XCTAssertEqual(pty.readMaster(), "\r\n")
34+
XCTAssertEqual(pty.readPrimary(), "\r\n")
3535

3636
// Test move cursor.
3737
term.moveCursor(up: 3)
38-
XCTAssertEqual(pty.readMaster(), "\u{1B}[3A")
38+
XCTAssertEqual(pty.readPrimary(), "\u{1B}[3A")
3939

4040
// Test color wrapping.
4141
var wrapped = term.wrap("hello", inColor: .noColor)

Tests/TSCUtilityTests/ProgressAnimationTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,18 @@ final class ProgressAnimationTests: XCTestCase {
108108

109109
var output = ""
110110
let thread = Thread {
111-
while let out = terminal.readMaster() {
111+
while let out = terminal.readPrimary() {
112112
output += out
113113
}
114114
}
115115

116116
thread.start()
117117
closure(terminal)
118-
terminal.closeSlave()
118+
terminal.closeSecondary()
119119

120120
// Make sure to read the complete output before checking it.
121121
thread.join()
122-
terminal.closeMaster()
122+
terminal.closePrimary()
123123

124124
return output
125125
}

0 commit comments

Comments
 (0)