Skip to content

Commit 5458a29

Browse files
committed
Pipeline: Enable unacceptable language checks
Enable the Unacceptable language checks in the repository and update the code base to remove such laguage. Fixes: #9395 Issue: rdar://164975556
1 parent 2096cff commit 5458a29

File tree

34 files changed

+239
-228
lines changed

34 files changed

+239
-228
lines changed

.unacceptablelanguageignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# contains a GitHub URL that does not have a main branch
2+
NOTICE.txt
3+
Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift
4+
Sources/PackageGraph/Resolution/PubGrub/Term.swift
5+
Sources/PackageGraph/VersionSetSpecifier.swift
6+
# use kill(...) API
7+
Sources/Basics/Cancellator.swift
8+
Sources/Basics/Concurrency/AsyncProcess.swift
9+
# Code recommends using branch `main` if it exists and `master` was provided in the Pacakge.swift
10+
Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
There are several types of contributions one can make. Bug fixes, documentation and enhancements that do not materially change the user facing semantics of Swift Package Manager should be submitted directly as PR.
44

5-
Larger changes that do materially change the semantics of Swift Package Manager (e.g. changes to the manifest format or behavior) are required to go through [Swift Evolution Process](https://github.com/swiftlang/swift-evolution/blob/master/process.md).
5+
Larger changes that do materially change the semantics of Swift Package Manager (e.g. changes to the manifest format or behavior) are required to go through [Swift Evolution Process](https://github.com/swiftlang/swift-evolution/blob/main/process.md).
66

77
To see how previous evolution decisions for SwiftPM have been made and have some direction for the development of future features please check out the [Community Proposals](https://forums.swift.org/tag/packagemanager).
88

@@ -16,7 +16,7 @@ Fill the following fields:
1616

1717
* `Title`: A one line summary of the problem you're facing.
1818
* `Description`: The complete description of the problem. Be specific.
19-
* `Expected behavior`: How you expect SwiftPM to behave.
19+
* `Expected behavior`: How you expect SwiftPM to behave.
2020
* `Actual behavior` : What actually happens.
2121
* `Steps to reproduce`: Be specific, provide steps to reproduce the bug.
2222
* `Swift Package Manager version/commit hash` : With which version are you testing.
@@ -510,5 +510,5 @@ Make sure to update your TSC (Tools Support Core):
510510
```bash
511511
$> swift package update
512512
```
513-
Alternatively, if you are using Xcode, you can update to the latest version of all packages:
513+
Alternatively, if you are using Xcode, you can update to the latest version of all packages:
514514
**Xcode App** > *File* > *Swift Packages* > *Update to Latest Package Versions*

Documentation/Design/EvolutionIdeas.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ If you're interested in participating in a particular evolution idea, please
1313
familiarize yourself with the existing discussion on that topic and start
1414
participating in the discussion thread of that idea. If a thread doesn't exist
1515
for that idea, please start one with a [draft
16-
proposal](https://github.com/swiftlang/swift-evolution/blob/master/proposal-templates/0000-swiftpm-template.md)
16+
proposal](https://github.com/swiftlang/swift-evolution/blob/main/proposal-templates/0000-swiftpm-template.md)
1717
that can be used as a starting point.
1818

1919
**Important Note**: This list is not in any particular order. I plan to keep

Documentation/PackageRegistry/Registry.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ Valid `Accept` header field values are described by the following rules:
186186
```
187187

188188
A server MUST set the `Content-Type` header field
189-
with the corresponding content type of the response.
189+
with the corresponding content type of the response.
190190

191191
A server MUST set the `Content-Version` header field
192-
with the API version number of the response, unless
193-
explicitly stated otherwise.
192+
with the API version number of the response, unless
193+
explicitly stated otherwise.
194194

195195
```http
196196
HTTP/1.1 200 OK
@@ -523,11 +523,11 @@ with a given combination of `name` and `type` values.
523523

524524
#### 4.2.2. Package release metadata standards
525525

526-
[Appendix B](#appendix-b---package-release-metadata-json-schema)
526+
[Appendix B](#appendix-b---package-release-metadata-json-schema)
527527
defines the JSON schema for package release metadata that
528528
gets submitted as part of the ["create a package release"](#endpoint-6)
529-
request. A server MAY allow and/or populate additional metadata by
530-
expanding the schema. The `metadata` key in the
529+
request. A server MAY allow and/or populate additional metadata by
530+
expanding the schema. The `metadata` key in the
531531
["fetch information about a package release "](#endpoint-2) API response
532532
will hold the user-provided as well as the server populated metadata.
533533

@@ -717,7 +717,7 @@ It is RECOMMENDED for clients and servers to support
717717
range requests as described by [RFC 7233]
718718
and caching as described by [RFC 7234].
719719

720-
If a release is signed, a server MUST include
720+
If a release is signed, a server MUST include
721721
`X-Swift-Package-Signature-Format` and `X-Swift-Package-Signature`
722722
headers in the response.
723723

@@ -777,7 +777,7 @@ Digest: sha-256=a2ac54cf25fbc1ad0028f03f0aa4b96833b83bb05a14e510892bb27dea4dc812
777777

778778
A client MUST validate the signature of a signed archive
779779
according to the signature format and configuration. Signing
780-
information can alternatively be found in the associated
780+
information can alternatively be found in the associated
781781
`source-archive` resource in the response to `GET /{scope}/{name}/{version}`,
782782
as described in [4.2.1](#421-package-release-resources).
783783

@@ -830,12 +830,12 @@ caching as described by [RFC 7234].
830830
#### 4.5.1 URL to package identifier mappings
831831

832832
As part of the [package release metadata](#422-package-release-metadata-standards)
833-
JSON object, the `repositoryURLs` array can be used to specify
834-
URLs associated with a package identifier. This is one way
835-
through which a server can obtain URL to package identifier
836-
mappings for this API.
833+
JSON object, the `repositoryURLs` array can be used to specify
834+
URLs associated with a package identifier. This is one way
835+
through which a server can obtain URL to package identifier
836+
mappings for this API.
837837

838-
A server MAY choose other mechanism(s) for package authors
838+
A server MAY choose other mechanism(s) for package authors
839839
to specify these mappings.
840840

841841
A server SHOULD validate the package author's ownership claim
@@ -859,19 +859,19 @@ with the following sections:
859859
| `metadata` | `application/json` | Additional information about the release. | OPTIONAL |
860860
| `metadata-signature` | `application/octet-stream` | The signature of the metadata. | OPTIONAL |
861861

862-
A client MUST set a `Content-Type` header with the value
862+
A client MUST set a `Content-Type` header with the value
863863
`multipart/form-data`. `boundary` can be any string.
864864

865865
A client MAY use any valid value (e.g., `binary`) for the
866866
`Content-Transfer-Encoding` header.
867867

868-
A client SHOULD set the `Content-Length` header with
868+
A client SHOULD set the `Content-Length` header with
869869
the total size of the body in bytes.
870870

871871
A client SHOULD set the `Accept` header with the value
872872
`application/vnd.swift.registry.v1+json`.
873873

874-
A client MUST set a `X-Swift-Package-Signature-Format` header
874+
A client MUST set a `X-Swift-Package-Signature-Format` header
875875
with the signature format if the source archive is signed.
876876

877877
```http
@@ -1079,7 +1079,7 @@ Content-Language: en
10791079
{
10801080
"detail": "invalid JSON provided for release metadata"
10811081
}
1082-
```
1082+
```
10831083

10841084
#### 4.6.3. Synchronous and asynchronous publication
10851085

@@ -1262,13 +1262,13 @@ See [registry.openapi.yaml](./registry.openapi.yaml).
12621262

12631263
## Appendix B - Package Release Metadata JSON Schema
12641264

1265-
The `metadata` section of the [create package release request](#46-create-a-package-release)
1265+
The `metadata` section of the [create package release request](#46-create-a-package-release)
12661266
must be a JSON object of type [`PackageRelease`](#packagerelease-type), as defined in the
12671267
JSON schema below.
12681268

12691269
<details>
12701270

1271-
<summary>Expand to view <a href="https://json-schema.org/specification.html">JSON schema</a></summary>
1271+
<summary>Expand to view <a href="https://json-schema.org/specification.html">JSON schema</a></summary>
12721272

12731273
```json
12741274
{
@@ -1282,52 +1282,52 @@ JSON schema below.
12821282
"type": "object",
12831283
"properties": {
12841284
"name": {
1285-
"type": "string",
1285+
"type": "string",
12861286
"description": "Name of the author."
1287-
},
1287+
},
12881288
"email": {
12891289
"type": "string",
12901290
"format": "email",
12911291
"description": "Email address of the author."
1292-
},
1292+
},
12931293
"description": {
1294-
"type": "string",
1294+
"type": "string",
12951295
"description": "A description of the author."
12961296
},
12971297
"organization": {
12981298
"type": "object",
12991299
"properties": {
13001300
"name": {
1301-
"type": "string",
1301+
"type": "string",
13021302
"description": "Name of the organization."
1303-
},
1303+
},
13041304
"email": {
13051305
"type": "string",
1306-
"format": "email",
1306+
"format": "email",
13071307
"description": "Email address of the organization."
1308-
},
1308+
},
13091309
"description": {
1310-
"type": "string",
1310+
"type": "string",
13111311
"description": "A description of the organization."
1312-
},
1312+
},
13131313
"url": {
13141314
"type": "string",
1315-
"format": "uri",
1315+
"format": "uri",
13161316
"description": "URL of the organization."
1317-
},
1317+
},
13181318
},
13191319
"required": ["name"]
1320-
},
1320+
},
13211321
"url": {
1322-
"type": "string",
1323-
"format": "uri",
1322+
"type": "string",
1323+
"format": "uri",
13241324
"description": "URL of the author."
1325-
},
1325+
},
13261326
},
13271327
"required": ["name"]
13281328
},
13291329
"description": {
1330-
"type": "string",
1330+
"type": "string",
13311331
"description": "A description of the package release."
13321332
},
13331333
"licenseURL": {
@@ -1342,7 +1342,7 @@ JSON schema below.
13421342
},
13431343
"readmeURL": {
13441344
"type": "string",
1345-
"format": "uri",
1345+
"format": "uri",
13461346
"description": "URL of the README specifically for the package release or broadly for the package."
13471347
},
13481348
"repositoryURLs": {
@@ -1351,7 +1351,7 @@ JSON schema below.
13511351
"items": {
13521352
"type": "string",
13531353
"description": "Code repository URL."
1354-
}
1354+
}
13551355
}
13561356
}
13571357
}
@@ -1427,6 +1427,6 @@ JSON schema below.
14271427
[thundering herd effect]: https://en.wikipedia.org/wiki/Thundering_herd_problem "Thundering herd problem"
14281428
[offline cache]: https://yarnpkg.com/features/offline-cache "Offline Cache | Yarn - Package Manager"
14291429
[XCFramework]: https://developer.apple.com/videos/play/wwdc2019/416/ "WWDC 2019 Session 416: Binary Frameworks in Swift"
1430-
[SE-0272]: https://github.com/swiftlang/swift-evolution/blob/master/proposals/0272-swiftpm-binary-dependencies.md "Package Manager Binary Dependencies"
1430+
[SE-0272]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0272-swiftpm-binary-dependencies.md "Package Manager Binary Dependencies"
14311431
[Swift tools version]: https://github.com/swiftlang/swift-package-manager/blob/9b9bed7eaf0f38eeccd0d8ca06ae08f6689d1c3f/Documentation/Usage.md#swift-tools-version-specification "Swift Tools Version Specification"
14321432
[ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html "ISO 8601 Date and Time Format"

Documentation/libSwiftPM.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A subset of `libSwiftPM` that includes only the data model (without SwiftPM's
1010
build system) is available as `libSwiftPMDataModel`. Any one client should
1111
depend on one or the other, but not both.
1212

13-
The SwiftPM repository contains an [example](https://github.com/swiftlang/swift-package-manager/tree/master/Examples/package-info) that demonstrates the use of
13+
The SwiftPM repository contains an [example](https://github.com/swiftlang/swift-package-manager/tree/main/Examples/package-info) that demonstrates the use of
1414
`libSwiftPM` in a Swift package. Use the following commands to run the example
1515
package:
1616

Fixtures/Collections/GitHub/license.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
"path": "LICENSE",
44
"sha": "401c59dcc4570b954dd6d345e76199e1f4e76266",
55
"size": 1077,
6-
"url": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master",
7-
"html_url": "https://github.com/benbalter/gman/blob/master/LICENSE",
6+
"url": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=main",
7+
"html_url": "https://github.com/benbalter/gman/blob/main/LICENSE",
88
"git_url": "https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266",
9-
"download_url": "https://raw.githubusercontent.com/benbalter/gman/master/LICENSE?lab=true",
9+
"download_url": "https://raw.githubusercontent.com/benbalter/gman/main/LICENSE?lab=true",
1010
"type": "file",
1111
"content": "VGhlIE1JVCBMaWNlbnNlIChNSVQpCgpDb3B5cmlnaHQgKGMpIDIwMTMgQmVu\nIEJhbHRlcgoKUGVybWlzc2lvbiBpcyBoZXJlYnkgZ3JhbnRlZCwgZnJlZSBv\nZiBjaGFyZ2UsIHRvIGFueSBwZXJzb24gb2J0YWluaW5nIGEgY29weSBvZgp0\naGlzIHNvZnR3YXJlIGFuZCBhc3NvY2lhdGVkIGRvY3VtZW50YXRpb24gZmls\nZXMgKHRoZSAiU29mdHdhcmUiKSwgdG8gZGVhbCBpbgp0aGUgU29mdHdhcmUg\nd2l0aG91dCByZXN0cmljdGlvbiwg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XSVRIIFRIRSBTT0ZUV0FSRSBPUiBU\nSEUgVVNFIE9SIE9USEVSIERFQUxJTkdTIElOIFRIRSBTT0ZUV0FSRS4K\n",
1212
"encoding": "base64",
1313
"_links": {
14-
"self": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master",
14+
"self": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=main",
1515
"git": "https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266",
16-
"html": "https://github.com/benbalter/gman/blob/master/LICENSE"
16+
"html": "https://github.com/benbalter/gman/blob/main/LICENSE"
1717
},
1818
"license": {
1919
"key": "mit",

Fixtures/Collections/GitHub/metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"watchers_count": 80,
7878
"watchers": 80,
7979
"size": 108,
80-
"default_branch": "master",
80+
"default_branch": "main",
8181
"open_issues_count": 0,
8282
"open_issues": 0,
8383
"is_template": true,
@@ -215,7 +215,7 @@
215215
"stargazers_count": 80,
216216
"watchers_count": 80,
217217
"size": 108,
218-
"default_branch": "master",
218+
"default_branch": "main",
219219
"open_issues_count": 0,
220220
"is_template": true,
221221
"topics": [
@@ -337,7 +337,7 @@
337337
"stargazers_count": 80,
338338
"watchers_count": 80,
339339
"size": 108,
340-
"default_branch": "master",
340+
"default_branch": "main",
341341
"open_issues_count": 0,
342342
"is_template": true,
343343
"topics": [

Fixtures/Collections/GitHub/readme.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
"sha": "3d21ec53a331a6f037a91c368710b99387d012c1",
99
"url": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md",
1010
"git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1",
11-
"html_url": "https://github.com/octokit/octokit.rb/blob/master/README.md",
12-
"download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md",
11+
"html_url": "https://github.com/octokit/octokit.rb/blob/main/README.md",
12+
"download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/README.md",
1313
"_links": {
1414
"git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1",
1515
"self": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md",
16-
"html": "https://github.com/octokit/octokit.rb/blob/master/README.md"
16+
"html": "https://github.com/octokit/octokit.rb/blob/main/README.md"
1717
}
1818
}

Fixtures/Collections/GitHub/releases.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"id": 1,
1010
"node_id": "MDc6UmVsZWFzZTE=",
1111
"tag_name": "v2.0.0",
12-
"target_commitish": "master",
12+
"target_commitish": "main",
1313
"name": "2.0.0",
1414
"body": "Description of the release",
1515
"draft": false,
@@ -72,7 +72,7 @@
7272
}
7373
}
7474
]
75-
},
75+
},
7676
{
7777
"url": "https://api.github.com/repos/octocat/Hello-World/releases/1",
7878
"html_url": "https://github.com/octocat/Hello-World/releases/v1.0.0",
@@ -83,7 +83,7 @@
8383
"id": 1,
8484
"node_id": "MDc6UmVsZWFzZTE=",
8585
"tag_name": "1.0.0",
86-
"target_commitish": "master",
86+
"target_commitish": "main",
8787
"name": "1.0.0",
8888
"body": "Description of the release",
8989
"draft": false,

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,10 +1162,10 @@ if !shouldUseSwiftBuildFramework {
11621162
]
11631163

11641164
if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
1165-
package.dependencies += [
1166-
.package(url: "https://github.com/swiftlang/swift-build.git", branch: relatedDependenciesBranch),
1167-
]
1168-
} else {
1165+
// package.dependencies += [
1166+
// .package(url: "https://github.com/swiftlang/swift-build.git", branch: relatedDependenciesBranch),
1167+
// ]
1168+
// } else {
11691169
package.dependencies += [
11701170
.package(path: "../swift-build"),
11711171
]

0 commit comments

Comments
 (0)