Skip to content

Commit d128742

Browse files
ktosoyim-lee
andauthored
Use inclusive language (#790)
* Use inclusive language * update formatting to be the same as in other projects * Update scripts/validate_language.sh Co-authored-by: Yim Lee <yim_lee@apple.com> Co-authored-by: Yim Lee <yim_lee@apple.com>
1 parent 61752a9 commit d128742

File tree

35 files changed

+102
-96
lines changed

35 files changed

+102
-96
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ IntegrationTests/tests_04_cluster/.build
2929
.swiftpm/
3030
Package.resolved
3131

32-
.GenActorInstruments-sanity.instrpkg
32+
.GenActorInstruments-soundness.instrpkg

CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ We require that your commit messages match our template. The easiest way to do t
6060

6161
git config commit.template dev/git.commit.template
6262

63-
### Run `./scripts/sanity.sh`
63+
### Run `./scripts/soundness.sh`
6464

65-
The scripts directory contains a [sanity.sh script](https://github.com/apple/swift-metrics/blob/master/scripts/sanity.sh)
65+
The scripts directory contains a [soundness.sh script](https://github.com/apple/swift-metrics/blob/master/scripts/soundness.sh)
6666
that enforces additional checks, like license headers and formatting style.
6767

68-
Please make sure to `./scripts/sanity.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
68+
Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
6969
on minor changes such as a missing `self.` or similar formatting issues.
7070

7171
> The script also executes the above mentioned `generate_linux_tests.rb`.
@@ -76,8 +76,8 @@ For frequent contributors, we recommend adding the script as a [git pre-push hoo
7676
cat << EOF > .git/hooks/pre-push
7777
#!/bin/bash
7878
79-
if [[ -f "scripts/sanity.sh" ]]; then
80-
scripts/sanity.sh
79+
if [[ -f "scripts/soundness.sh" ]]; then
80+
scripts/soundness.sh
8181
fi
8282
EOF
8383
```

Docs/clustering.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ In these scenarios it is most useful to work with subscriptions and react to the
261261

262262
==== Membership Snapshot
263263

264-
Sometimes however, one just wants to perform a sanity check or printout without having to subscribe to the membership events actively.
264+
Sometimes however, one just wants to perform a check or printout without having to subscribe to the membership events actively.
265265
Note, however, that no strong guarantees are made about "how up to date" that value is, and even the moment after one has checked it, it may have already changed, e.g. another member has become leader.
266266
Take this into consideration when opting to use this style of `Cluster.Membership` interaction.
267267

Instruments/GenActorInstruments/Package.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
import PackageDescription
55

66
var targets: [PackageDescription.Target] = [
7-
87
.target(
98
name: "SwiftyInstrumentsPackageDefinition",
109
dependencies: []
1110
),
12-
1311
]
1412

1513
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
@@ -19,8 +17,7 @@ var targets: [PackageDescription.Target] = [
1917

2018
targets.append(
2119
contentsOf: [
22-
23-
// ==== ----------------------------------------------------------------------------------------------------------------
20+
// ==== --------------------------------------------------------------------------------------------------------
2421
// MARK: Actor Instruments Package Definition
2522

2623
.target(
@@ -31,7 +28,7 @@ targets.append(
3128
]
3229
),
3330

34-
// ==== ------------------------------------------------------------------------------------------------------------
31+
// ==== --------------------------------------------------------------------------------------------------------
3532
// MARK: GenActorInstruments
3633

3734
.target(
@@ -54,7 +51,7 @@ var dependencies: [Package.Dependency] = [
5451

5552
// ~~~ for rendering the PackageDefinition XML ~~~
5653
.package(url: "https://github.com/MaxDesiatov/XMLCoder.git", from: "0.11.1"), // MIT
57-
.package(url: "https://github.com/apple/swift-argument-parser", .exact("0.0.6")), // not API stable, Apache v2
54+
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "0.3.2")), // not API stable, Apache v2
5855
]
5956

6057
let package = Package(

Instruments/GenActorInstruments/Sources/ActorInstrumentsPackageDefinition/ActorInstrumentsPackageDefinition.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ extension Column {
231231
type: .uint32,
232232
expression: "?regs"
233233
)
234-
235234
}
236235

237236
@available(OSX 10.14, *)
@@ -578,7 +577,6 @@ public struct ActorInstrumentsPackageDefinition {
578577
}
579578
}
580579

581-
582580
public var packageDefinition: PackageDefinition {
583581
PackageDefinition(
584582
id: packageID,
@@ -598,7 +596,7 @@ public struct ActorInstrumentsPackageDefinition {
598596

599597
// messages (ask)
600598
Schemas.actorAskedInterval
601-
599+
602600
// watches
603601
Schemas.actorWatches
604602

@@ -634,7 +632,7 @@ public struct ActorInstrumentsPackageDefinition {
634632
table: tableActorLifecycleSpawns
635633
) {
636634
Graph.Histogram(
637-
// TODO slice?
635+
// TODO: slice?
638636
nanosecondsPerBucket: Int(TimeAmount.seconds(1).nanoseconds),
639637
mode: .count(.actorPath)
640638
)
@@ -647,8 +645,8 @@ public struct ActorInstrumentsPackageDefinition {
647645
Graph.Histogram(
648646
slice: [
649647
Instrument.Slice(
650-
column: .actorStopReason, "stop" // FIXME:also count crashes as stops
651-
)
648+
column: .actorStopReason, "stop" // FIXME: also count crashes as stops
649+
),
652650
],
653651
nanosecondsPerBucket: Int(TimeAmount.seconds(1).nanoseconds),
654652
mode: .count(.actorPath)

Instruments/GenActorInstruments/Sources/ActorInstrumentsPackageDefinition/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import Logging
1615
import GenActorInstruments
16+
import Logging
1717

1818
LoggingSystem.bootstrap(StreamLogHandler.standardError)
1919

Instruments/GenActorInstruments/Sources/GenActorInstruments/GenerateActorInstrumentsPackageDefinition.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import SwiftyInstrumentsPackageDefinition
1615
import ArgumentParser
1716
import DistributedActors
1817
import Foundation
19-
import XMLCoder
2018
import Logging
19+
import SwiftyInstrumentsPackageDefinition
20+
import XMLCoder
2121

2222
public struct InstrumentsPackageDefinitionGenerator {
2323
let log: Logger = Logger(label: "gen-package-def")
@@ -45,12 +45,10 @@ public struct InstrumentsPackageDefinitionGenerator {
4545
self.log.info("Rendered: \(self.settings.output)")
4646
self.log.info("To format the generates XML you may want to pipe through: xmllint --output Instruments/ActorInstruments/ActorInstruments/ActorInstruments.instrpkg --format -")
4747

48-
4948
self.log.info("""
50-
To generate package using Xcode:
51-
open ./Instruments/ActorInstruments/ActorInstruments.xcodeproj
52-
""")
53-
49+
To generate package using Xcode:
50+
open ./Instruments/ActorInstruments/ActorInstruments.xcodeproj
51+
""")
5452

5553
if self.settings.stdout {
5654
print(renderedXML)
@@ -89,4 +87,3 @@ extension InstrumentsPackageDefinitionGenerator {
8987
var output: String
9088
}
9189
}
92-

Instruments/GenActorInstruments/Sources/SwiftyInstrumentsPackageDefinition/InstrumentsPackageDefinition+Coding.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ extension PackageDefinition.Instrument.ImportParameter {
317317
try container.encode(self.fromScope, forKey: .fromScope)
318318
try container.encode(self.name, forKey: .name)
319319
}
320-
321320
}
322321

323322
extension PackageDefinition.Instrument.CreateTable {
@@ -416,7 +415,7 @@ extension PackageDefinition.Instrument.Graph.Lane {
416415

417416
try self.plots.forEach { try container.encode($0, forKey: .plot) }
418417
try self.plotTemplates.forEach { try container.encode($0, forKey: .plotTemplates) }
419-
try self.histograms.forEach { try container.encode($0, forKey: .histograms)}
418+
try self.histograms.forEach { try container.encode($0, forKey: .histograms) }
420419
// try self.histogramsTemplates.forEach { try container.encode($0, forKey: .histogramsTemplates)} // TODO: implement this
421420
}
422421
}

Instruments/GenActorInstruments/Sources/SwiftyInstrumentsPackageDefinition/InstrumentsPackageDefinition.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ extension PackageDefinition {
238238
type: .duration, // TODO: is this right?
239239
expression: "?duration",
240240
hidden: true
241-
)
241+
),
242242
]
243243
self.collect(builder())
244244

@@ -263,7 +263,7 @@ extension PackageDefinition {
263263
for v in variables {
264264
precondition(
265265
"\(self.startPattern)".contains("\(v)") ||
266-
"\(self.endPattern)".contains("\(v)"),
266+
"\(self.endPattern)".contains("\(v)"),
267267
"""
268268
Variable '?\(v)' must appear in pattern to be used in a later expression.
269269
Start Pattern: \(self.startPattern)
@@ -357,7 +357,7 @@ extension PackageDefinition {
357357
hidden: true
358358
),
359359
]
360-
360+
361361
self.collect(builder())
362362
self.validate()
363363
}
@@ -414,7 +414,7 @@ public struct Mnemonic: Encodable, ExpressibleByStringLiteral, Hashable, CustomS
414414
public let name: String
415415

416416
/// The mnemonic was set via an explicit reference to a Column or similar,
417-
/// and thus we should assume we can run sanity checks including it (e.g. if a targeted schema
417+
/// and thus we should assume we can run checks including it (e.g. if a targeted schema
418418
/// includes a column identified with this mnemonic etc).
419419
public var definedUsingWellTypedReference: Bool
420420

@@ -532,7 +532,7 @@ public struct Column: Encodable, SchemaElementConvertible, MnemonicConvertible {
532532
}
533533

534534
var notHidden: Bool {
535-
return !self.hidden
535+
!self.hidden
536536
}
537537

538538
public func asSchemaElement() -> SchemaElement {
@@ -1197,8 +1197,8 @@ extension PackageDefinition.Instrument {
11971197
///
11981198
/// - SeeAlso: https://help.apple.com/instruments/developer/mac/current/#/dev455934374
11991199
public struct Histogram: Encodable, GraphLaneElementConvertible {
1200-
/// Specifies a filter that should be applied to the input data in table-ref
1201-
public var slice: [Slice] // 1-3
1200+
/// Specifies a filter that should be applied to the input data in table-ref
1201+
public var slice: [Slice] // 1-3
12021202

12031203
// /// Flags the histogram as being ideal for a particular time resolution.
12041204
// best-for-resolution {1,3}
@@ -1540,7 +1540,7 @@ extension PackageDefinition.Instrument {
15401540
func hasColumn(_ col: Mnemonic) -> Bool {
15411541
self.schemaRef.hasColumn(col)
15421542
}
1543-
1543+
15441544
public init(_ table: PackageDefinition.Instrument.CreateTable) {
15451545
self.id = table.id
15461546
self.schemaRef = table.schemaRef

IntegrationTests/disabled_tests_03_xpc_actorable/it_XPCActorable_echo_api/XPCEchoServiceProtocol.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import DistributedActors
1616
import DistributedActorsXPC
1717

1818
public protocol XPCEchoServiceProtocol: XPCActorableProtocol {
19-
2019
// @actor
2120
func echo(string: String) -> String
2221

0 commit comments

Comments
 (0)