diff --git a/.unacceptablelanguageignore b/.unacceptablelanguageignore new file mode 100644 index 00000000000..29c3f97d122 --- /dev/null +++ b/.unacceptablelanguageignore @@ -0,0 +1,10 @@ +# contains a GitHub URL that does not have a main branch +NOTICE.txt +Sources/PackageGraph/Resolution/PubGrub/PubGrubDependencyResolver.swift +Sources/PackageGraph/Resolution/PubGrub/Term.swift +Sources/PackageGraph/VersionSetSpecifier.swift +# use kill(...) API +Sources/Basics/Cancellator.swift +Sources/Basics/Concurrency/AsyncProcess.swift +# Code recommends using branch `main` if it exists and `master` was provided in the Pacakge.swift +Sources/Workspace/PackageContainer/SourceControlPackageContainer.swift diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 13763291b95..213aa89ae6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ 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. -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). +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). 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). @@ -16,7 +16,7 @@ Fill the following fields: * `Title`: A one line summary of the problem you're facing. * `Description`: The complete description of the problem. Be specific. -* `Expected behavior`: How you expect SwiftPM to behave. +* `Expected behavior`: How you expect SwiftPM to behave. * `Actual behavior` : What actually happens. * `Steps to reproduce`: Be specific, provide steps to reproduce the bug. * `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): ```bash $> swift package update ``` -Alternatively, if you are using Xcode, you can update to the latest version of all packages: +Alternatively, if you are using Xcode, you can update to the latest version of all packages: **Xcode App** > *File* > *Swift Packages* > *Update to Latest Package Versions* diff --git a/Documentation/Design/EvolutionIdeas.md b/Documentation/Design/EvolutionIdeas.md index cd445c4f1c4..61903902d2d 100644 --- a/Documentation/Design/EvolutionIdeas.md +++ b/Documentation/Design/EvolutionIdeas.md @@ -13,7 +13,7 @@ If you're interested in participating in a particular evolution idea, please familiarize yourself with the existing discussion on that topic and start participating in the discussion thread of that idea. If a thread doesn't exist for that idea, please start one with a [draft -proposal](https://github.com/swiftlang/swift-evolution/blob/master/proposal-templates/0000-swiftpm-template.md) +proposal](https://github.com/swiftlang/swift-evolution/blob/main/proposal-templates/0000-swiftpm-template.md) that can be used as a starting point. **Important Note**: This list is not in any particular order. I plan to keep diff --git a/Documentation/PackageRegistry/Registry.md b/Documentation/PackageRegistry/Registry.md index b428dce6c9e..93afc3513a1 100644 --- a/Documentation/PackageRegistry/Registry.md +++ b/Documentation/PackageRegistry/Registry.md @@ -186,11 +186,11 @@ Valid `Accept` header field values are described by the following rules: ``` A server MUST set the `Content-Type` header field -with the corresponding content type of the response. +with the corresponding content type of the response. A server MUST set the `Content-Version` header field -with the API version number of the response, unless -explicitly stated otherwise. +with the API version number of the response, unless +explicitly stated otherwise. ```http HTTP/1.1 200 OK @@ -523,11 +523,11 @@ with a given combination of `name` and `type` values. #### 4.2.2. Package release metadata standards -[Appendix B](#appendix-b---package-release-metadata-json-schema) +[Appendix B](#appendix-b---package-release-metadata-json-schema) defines the JSON schema for package release metadata that gets submitted as part of the ["create a package release"](#endpoint-6) -request. A server MAY allow and/or populate additional metadata by -expanding the schema. The `metadata` key in the +request. A server MAY allow and/or populate additional metadata by +expanding the schema. The `metadata` key in the ["fetch information about a package release "](#endpoint-2) API response will hold the user-provided as well as the server populated metadata. @@ -717,7 +717,7 @@ It is RECOMMENDED for clients and servers to support range requests as described by [RFC 7233] and caching as described by [RFC 7234]. -If a release is signed, a server MUST include +If a release is signed, a server MUST include `X-Swift-Package-Signature-Format` and `X-Swift-Package-Signature` headers in the response. @@ -777,7 +777,7 @@ Digest: sha-256=a2ac54cf25fbc1ad0028f03f0aa4b96833b83bb05a14e510892bb27dea4dc812 A client MUST validate the signature of a signed archive according to the signature format and configuration. Signing -information can alternatively be found in the associated +information can alternatively be found in the associated `source-archive` resource in the response to `GET /{scope}/{name}/{version}`, as described in [4.2.1](#421-package-release-resources). @@ -830,12 +830,12 @@ caching as described by [RFC 7234]. #### 4.5.1 URL to package identifier mappings As part of the [package release metadata](#422-package-release-metadata-standards) -JSON object, the `repositoryURLs` array can be used to specify -URLs associated with a package identifier. This is one way -through which a server can obtain URL to package identifier -mappings for this API. +JSON object, the `repositoryURLs` array can be used to specify +URLs associated with a package identifier. This is one way +through which a server can obtain URL to package identifier +mappings for this API. -A server MAY choose other mechanism(s) for package authors +A server MAY choose other mechanism(s) for package authors to specify these mappings. A server SHOULD validate the package author's ownership claim @@ -859,19 +859,19 @@ with the following sections: | `metadata` | `application/json` | Additional information about the release. | OPTIONAL | | `metadata-signature` | `application/octet-stream` | The signature of the metadata. | OPTIONAL | -A client MUST set a `Content-Type` header with the value +A client MUST set a `Content-Type` header with the value `multipart/form-data`. `boundary` can be any string. A client MAY use any valid value (e.g., `binary`) for the `Content-Transfer-Encoding` header. -A client SHOULD set the `Content-Length` header with +A client SHOULD set the `Content-Length` header with the total size of the body in bytes. A client SHOULD set the `Accept` header with the value `application/vnd.swift.registry.v1+json`. -A client MUST set a `X-Swift-Package-Signature-Format` header +A client MUST set a `X-Swift-Package-Signature-Format` header with the signature format if the source archive is signed. ```http @@ -1079,7 +1079,7 @@ Content-Language: en { "detail": "invalid JSON provided for release metadata" } -``` +``` #### 4.6.3. Synchronous and asynchronous publication @@ -1262,13 +1262,13 @@ See [registry.openapi.yaml](./registry.openapi.yaml). ## Appendix B - Package Release Metadata JSON Schema -The `metadata` section of the [create package release request](#46-create-a-package-release) +The `metadata` section of the [create package release request](#46-create-a-package-release) must be a JSON object of type [`PackageRelease`](#packagerelease-type), as defined in the JSON schema below.
-Expand to view JSON schema +Expand to view JSON schema ```json { @@ -1282,52 +1282,52 @@ JSON schema below. "type": "object", "properties": { "name": { - "type": "string", + "type": "string", "description": "Name of the author." - }, + }, "email": { "type": "string", "format": "email", "description": "Email address of the author." - }, + }, "description": { - "type": "string", + "type": "string", "description": "A description of the author." }, "organization": { "type": "object", "properties": { "name": { - "type": "string", + "type": "string", "description": "Name of the organization." - }, + }, "email": { "type": "string", - "format": "email", + "format": "email", "description": "Email address of the organization." - }, + }, "description": { - "type": "string", + "type": "string", "description": "A description of the organization." - }, + }, "url": { "type": "string", - "format": "uri", + "format": "uri", "description": "URL of the organization." - }, + }, }, "required": ["name"] - }, + }, "url": { - "type": "string", - "format": "uri", + "type": "string", + "format": "uri", "description": "URL of the author." - }, + }, }, "required": ["name"] }, "description": { - "type": "string", + "type": "string", "description": "A description of the package release." }, "licenseURL": { @@ -1342,7 +1342,7 @@ JSON schema below. }, "readmeURL": { "type": "string", - "format": "uri", + "format": "uri", "description": "URL of the README specifically for the package release or broadly for the package." }, "repositoryURLs": { @@ -1351,7 +1351,7 @@ JSON schema below. "items": { "type": "string", "description": "Code repository URL." - } + } } } } @@ -1427,6 +1427,6 @@ JSON schema below. [thundering herd effect]: https://en.wikipedia.org/wiki/Thundering_herd_problem "Thundering herd problem" [offline cache]: https://yarnpkg.com/features/offline-cache "Offline Cache | Yarn - Package Manager" [XCFramework]: https://developer.apple.com/videos/play/wwdc2019/416/ "WWDC 2019 Session 416: Binary Frameworks in Swift" -[SE-0272]: https://github.com/swiftlang/swift-evolution/blob/master/proposals/0272-swiftpm-binary-dependencies.md "Package Manager Binary Dependencies" +[SE-0272]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0272-swiftpm-binary-dependencies.md "Package Manager Binary Dependencies" [Swift tools version]: https://github.com/swiftlang/swift-package-manager/blob/9b9bed7eaf0f38eeccd0d8ca06ae08f6689d1c3f/Documentation/Usage.md#swift-tools-version-specification "Swift Tools Version Specification" [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html "ISO 8601 Date and Time Format" diff --git a/Documentation/libSwiftPM.md b/Documentation/libSwiftPM.md index 7ea9c64621e..2a0d768dc04 100644 --- a/Documentation/libSwiftPM.md +++ b/Documentation/libSwiftPM.md @@ -10,7 +10,7 @@ A subset of `libSwiftPM` that includes only the data model (without SwiftPM's build system) is available as `libSwiftPMDataModel`. Any one client should depend on one or the other, but not both. -The SwiftPM repository contains an [example](https://github.com/swiftlang/swift-package-manager/tree/master/Examples/package-info) that demonstrates the use of +The SwiftPM repository contains an [example](https://github.com/swiftlang/swift-package-manager/tree/main/Examples/package-info) that demonstrates the use of `libSwiftPM` in a Swift package. Use the following commands to run the example package: diff --git a/Fixtures/Collections/GitHub/license.json b/Fixtures/Collections/GitHub/license.json index 4e56f156b95..98cced18802 100644 --- a/Fixtures/Collections/GitHub/license.json +++ b/Fixtures/Collections/GitHub/license.json @@ -3,17 +3,17 @@ "path": "LICENSE", "sha": "401c59dcc4570b954dd6d345e76199e1f4e76266", "size": 1077, - "url": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master", - "html_url": "https://github.com/benbalter/gman/blob/master/LICENSE", + "url": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=main", + "html_url": "https://github.com/benbalter/gman/blob/main/LICENSE", "git_url": "https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266", - "download_url": "https://raw.githubusercontent.com/benbalter/gman/master/LICENSE?lab=true", + "download_url": "https://raw.githubusercontent.com/benbalter/gman/main/LICENSE?lab=true", "type": "file", "content": "VGhlIE1JVCBMaWNlbnNlIChNSVQpCgpDb3B5cmlnaHQgKGMpIDIwMTMgQmVu\nIEJhbHRlcgoKUGVybWlzc2lvbiBpcyBoZXJlYnkgZ3JhbnRlZCwgZnJlZSBv\nZiBjaGFyZ2UsIHRvIGFueSBwZXJzb24gb2J0YWluaW5nIGEgY29weSBvZgp0\naGlzIHNvZnR3YXJlIGFuZCBhc3NvY2lhdGVkIGRvY3VtZW50YXRpb24gZmls\nZXMgKHRoZSAiU29mdHdhcmUiKSwgdG8gZGVhbCBpbgp0aGUgU29mdHdhcmUg\nd2l0aG91dCByZXN0cmljdGlvbiwgaW5jbHVkaW5nIHdpdGhvdXQgbGltaXRh\ndGlvbiB0aGUgcmlnaHRzIHRvCnVzZSwgY29weSwgbW9kaWZ5LCBtZXJnZSwg\ncHVibGlzaCwgZGlzdHJpYnV0ZSwgc3VibGljZW5zZSwgYW5kL29yIHNlbGwg\nY29waWVzIG9mCnRoZSBTb2Z0d2FyZSwgYW5kIHRvIHBlcm1pdCBwZXJzb25z\nIHRvIHdob20gdGhlIFNvZnR3YXJlIGlzIGZ1cm5pc2hlZCB0byBkbyBzbywK\nc3ViamVjdCB0byB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnM6CgpUaGUgYWJv\ndmUgY29weXJpZ2h0IG5vdGljZSBhbmQgdGhpcyBwZXJtaXNzaW9uIG5vdGlj\nZSBzaGFsbCBiZSBpbmNsdWRlZCBpbiBhbGwKY29waWVzIG9yIHN1YnN0YW50\naWFsIHBvcnRpb25zIG9mIHRoZSBTb2Z0d2FyZS4KClRIRSBTT0ZUV0FSRSBJ\nUyBQUk9WSURFRCAiQVMgSVMiLCBXSVRIT1VUIFdBUlJBTlRZIE9GIEFOWSBL\nSU5ELCBFWFBSRVNTIE9SCklNUExJRUQsIElOQ0xVRElORyBCVVQgTk9UIExJ\nTUlURUQgVE8gVEhFIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZLCBG\nSVRORVNTCkZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRSBBTkQgTk9OSU5GUklO\nR0VNRU5ULiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUgQVVUSE9SUyBPUgpDT1BZ\nUklHSFQgSE9MREVSUyBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFNQUdF\nUyBPUiBPVEhFUiBMSUFCSUxJVFksIFdIRVRIRVIKSU4gQU4gQUNUSU9OIE9G\nIENPTlRSQUNULCBUT1JUIE9SIE9USEVSV0lTRSwgQVJJU0lORyBGUk9NLCBP\nVVQgT0YgT1IgSU4KQ09OTkVDVElPTiBXSVRIIFRIRSBTT0ZUV0FSRSBPUiBU\nSEUgVVNFIE9SIE9USEVSIERFQUxJTkdTIElOIFRIRSBTT0ZUV0FSRS4K\n", "encoding": "base64", "_links": { - "self": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=master", + "self": "https://api.github.com/repos/benbalter/gman/contents/LICENSE?ref=main", "git": "https://api.github.com/repos/benbalter/gman/git/blobs/401c59dcc4570b954dd6d345e76199e1f4e76266", - "html": "https://github.com/benbalter/gman/blob/master/LICENSE" + "html": "https://github.com/benbalter/gman/blob/main/LICENSE" }, "license": { "key": "mit", diff --git a/Fixtures/Collections/GitHub/metadata.json b/Fixtures/Collections/GitHub/metadata.json index 7e55c325e73..52433b326f4 100644 --- a/Fixtures/Collections/GitHub/metadata.json +++ b/Fixtures/Collections/GitHub/metadata.json @@ -77,7 +77,7 @@ "watchers_count": 80, "watchers": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "open_issues": 0, "is_template": true, @@ -215,7 +215,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ @@ -337,7 +337,7 @@ "stargazers_count": 80, "watchers_count": 80, "size": 108, - "default_branch": "master", + "default_branch": "main", "open_issues_count": 0, "is_template": true, "topics": [ diff --git a/Fixtures/Collections/GitHub/readme.json b/Fixtures/Collections/GitHub/readme.json index 34a6f61254c..3fd3aa8b60d 100644 --- a/Fixtures/Collections/GitHub/readme.json +++ b/Fixtures/Collections/GitHub/readme.json @@ -8,11 +8,11 @@ "sha": "3d21ec53a331a6f037a91c368710b99387d012c1", "url": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md", "git_url": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", - "html_url": "https://github.com/octokit/octokit.rb/blob/master/README.md", - "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md", + "html_url": "https://github.com/octokit/octokit.rb/blob/main/README.md", + "download_url": "https://raw.githubusercontent.com/octokit/octokit.rb/main/README.md", "_links": { "git": "https://api.github.com/repos/octokit/octokit.rb/git/blobs/3d21ec53a331a6f037a91c368710b99387d012c1", "self": "https://api.github.com/repos/octokit/octokit.rb/contents/README.md", - "html": "https://github.com/octokit/octokit.rb/blob/master/README.md" + "html": "https://github.com/octokit/octokit.rb/blob/main/README.md" } } diff --git a/Fixtures/Collections/GitHub/releases.json b/Fixtures/Collections/GitHub/releases.json index feefea7bbc3..bc091ac1655 100644 --- a/Fixtures/Collections/GitHub/releases.json +++ b/Fixtures/Collections/GitHub/releases.json @@ -9,7 +9,7 @@ "id": 1, "node_id": "MDc6UmVsZWFzZTE=", "tag_name": "v2.0.0", - "target_commitish": "master", + "target_commitish": "main", "name": "2.0.0", "body": "Description of the release", "draft": false, @@ -72,7 +72,7 @@ } } ] - }, + }, { "url": "https://api.github.com/repos/octocat/Hello-World/releases/1", "html_url": "https://github.com/octocat/Hello-World/releases/v1.0.0", @@ -83,7 +83,7 @@ "id": 1, "node_id": "MDc6UmVsZWFzZTE=", "tag_name": "1.0.0", - "target_commitish": "master", + "target_commitish": "main", "name": "1.0.0", "body": "Description of the release", "draft": false, diff --git a/Sources/Basics/Triple+Basics.swift b/Sources/Basics/Triple+Basics.swift index e1f33bd31dc..da99407bd78 100644 --- a/Sources/Basics/Triple+Basics.swift +++ b/Sources/Basics/Triple+Basics.swift @@ -217,7 +217,6 @@ extension Triple { case _ where isDarwin(): return ".bundle" default: - // See: https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/FHS%20Bundles.md return ".resources" } } diff --git a/Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift b/Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift index 9a59bf3fff2..53a5a73bf96 100644 --- a/Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift +++ b/Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift @@ -791,7 +791,7 @@ public final class SwiftModuleBuildDescription { } func writeOutputFileMap(to path: AbsolutePath) throws { - let masterDepsPath = self.tempsPath.appending("master.swiftdeps") + let mainDepsPath = self.tempsPath.appending("main.swiftdeps") var content = #""" @@ -822,7 +822,7 @@ public final class SwiftModuleBuildDescription { } content += #""" - "swift-dependencies": "\#(masterDepsPath._nativePathString(escaped: true))" + "swift-dependencies": "\#(mainDepsPath._nativePathString(escaped: true))" }, """# @@ -1043,7 +1043,7 @@ public final class SwiftModuleBuildDescription { let toolchainFlags = self.buildParameters.toolchain.extraFlags.swiftCompilerFlags if toolchainFlags.contains(queryFlags) { return true } - + let generalFlags = self.buildParameters.flags.swiftCompilerFlags if generalFlags.contains(queryFlags) { return true } diff --git a/Sources/PackageCollectionsSigning/Signature.swift b/Sources/PackageCollectionsSigning/Signature.swift index 76e27d45d10..7a7ac509723 100644 --- a/Sources/PackageCollectionsSigning/Signature.swift +++ b/Sources/PackageCollectionsSigning/Signature.swift @@ -64,7 +64,7 @@ extension Signature { } } -// Reference: https://github.com/vapor/jwt-kit/blob/master/Sources/JWTKit/JWTSerializer.swift +// Reference: https://github.com/vapor/jwt-kit/blob/main/Sources/JWTKit/JWTSerializer.swift extension Signature { static let rsaSigningPadding = _RSA.Signing.Padding.insecurePKCS1v1_5 @@ -100,7 +100,7 @@ extension Signature { } } -// Reference: https://github.com/vapor/jwt-kit/blob/master/Sources/JWTKit/JWTParser.swift +// Reference: https://github.com/vapor/jwt-kit/blob/main/Sources/JWTKit/JWTParser.swift extension Signature { typealias CertChainValidate = ([Data]) async throws -> [Certificate] diff --git a/Sources/PackageCollectionsSigning/Utilities/Base64URL.swift b/Sources/PackageCollectionsSigning/Utilities/Base64URL.swift index bae48bb4c62..fa803b7052e 100644 --- a/Sources/PackageCollectionsSigning/Utilities/Base64URL.swift +++ b/Sources/PackageCollectionsSigning/Utilities/Base64URL.swift @@ -25,7 +25,7 @@ import Foundation -// Source: https://github.com/vapor/jwt-kit/blob/master/Sources/JWTKit/Utilities/Base64URL.swift +// Source: https://github.com/vapor/jwt-kit/blob/main/Sources/JWTKit/Utilities/Base64URL.swift extension DataProtocol { func base64URLDecodedBytes() -> Data? { diff --git a/Sources/PackageLoading/ModuleMapGenerator.swift b/Sources/PackageLoading/ModuleMapGenerator.swift index 1355a90328f..a358e72c9a9 100644 --- a/Sources/PackageLoading/ModuleMapGenerator.swift +++ b/Sources/PackageLoading/ModuleMapGenerator.swift @@ -58,7 +58,7 @@ extension ClangModule: ModuleMapProtocol { /// * Otherwise, if the "include" directory only contains header files and no other subdirectory: /// Generates: `umbrella "path/to/include"` /// -/// These rules are documented at https://github.com/swiftlang/swift-package-manager/blob/master/Documentation/Usage.md#creating-c-language-targets. To avoid breaking existing packages, do not change the semantics here without making any change conditional on the tools version of the package that defines the module. +/// These rules are documented at https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Usage.md#creating-c-language-targets. To avoid breaking existing packages, do not change the semantics here without making any change conditional on the tools version of the package that defines the module. /// /// Note that a module map generator doesn't require a module to already have been instantiated; it can operate on information that will later be used to instantiate a module. public struct ModuleMapGenerator { @@ -84,7 +84,7 @@ public struct ModuleMapGenerator { /// Inspects the file system at the public-headers directory with which the module map generator was instantiated, and returns the type of module map that applies to that directory. This function contains all of the heuristics that implement module map policy for package targets; other functions just use the results of this determination. public func determineModuleMapType(observabilityScope: ObservabilityScope) -> ModuleMapType { - // The following rules are documented at https://github.com/swiftlang/swift-package-manager/blob/master/Documentation/Usage.md#creating-c-language-targets. To avoid breaking existing packages, do not change the semantics here without making any change conditional on the tools version of the package that defines the module. + // The following rules are documented at https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Usage.md#creating-c-language-targets. To avoid breaking existing packages, do not change the semantics here without making any change conditional on the tools version of the package that defines the module. let diagnosticsEmitter = observabilityScope.makeDiagnosticsEmitter { var metadata = ObservabilityMetadata() diff --git a/Sources/PackageManagerDocs/Documentation.docc/PackageCollections/PackageCollectionDescribe.md b/Sources/PackageManagerDocs/Documentation.docc/PackageCollections/PackageCollectionDescribe.md index 3911c9dd044..58683b0c44f 100644 --- a/Sources/PackageManagerDocs/Documentation.docc/PackageCollections/PackageCollectionDescribe.md +++ b/Sources/PackageManagerDocs/Documentation.docc/PackageCollections/PackageCollectionDescribe.md @@ -52,7 +52,7 @@ $ swift package-collection describe [--json] https://github.com/jpsim/yams Description: A sweet and swifty YAML parser built on LibYAML. Available Versions: 4.0.0, 3.0.0, ... Stars: 14 -Readme: https://github.com/jpsim/Yams/blob/master/README.md +Readme: https://github.com/jpsim/Yams/blob/main/README.md Authors: @norio-nomura, @jpsim -------------------------------------------------------------- Latest Version: 4.0.0 @@ -220,7 +220,7 @@ specify more than one path.* - term **--color-diagnostics|no-color-diagnostics**: -*Enables or disables color diagnostics when printing to a TTY. +*Enables or disables color diagnostics when printing to a TTY. By default, color diagnostics are enabled when connected to a TTY and disabled otherwise.* diff --git a/Sources/PackageManagerDocs/Documentation.docc/RegistryServerSpecification.md b/Sources/PackageManagerDocs/Documentation.docc/RegistryServerSpecification.md index 453497e5564..9e7076a7b47 100644 --- a/Sources/PackageManagerDocs/Documentation.docc/RegistryServerSpecification.md +++ b/Sources/PackageManagerDocs/Documentation.docc/RegistryServerSpecification.md @@ -153,11 +153,11 @@ Valid `Accept` header field values are described by the following rules: ``` A server MUST set the `Content-Type` header field -with the corresponding content type of the response. +with the corresponding content type of the response. A server MUST set the `Content-Version` header field -with the API version number of the response, unless -explicitly stated otherwise. +with the API version number of the response, unless +explicitly stated otherwise. ```http HTTP/1.1 200 OK @@ -490,11 +490,11 @@ with a given combination of `name` and `type` values. ##### 4.2.2. Package release metadata standards - [Appendix B]() + [Appendix B]() defines the JSON schema for package release metadata that gets submitted as part of the ["create a package release"]() - request. A server MAY allow and/or populate additional metadata by - expanding the schema. The `metadata` key in the + request. A server MAY allow and/or populate additional metadata by + expanding the schema. The `metadata` key in the ["fetch information about a package release"]() API response will hold the user-provided as well as the server populated metadata. @@ -684,7 +684,7 @@ It is RECOMMENDED for clients and servers to support range requests as described by [RFC 7233] and caching as described by [RFC 7234]. -If a release is signed, a server MUST include +If a release is signed, a server MUST include `X-Swift-Package-Signature-Format` and `X-Swift-Package-Signature` headers in the response. @@ -744,7 +744,7 @@ Digest: sha-256=a2ac54cf25fbc1ad0028f03f0aa4b96833b83bb05a14e510892bb27dea4dc812 A client MUST validate the signature of a signed archive according to the signature format and configuration. Signing -information can alternatively be found in the associated +information can alternatively be found in the associated `source-archive` resource in the response to `GET /{scope}/{name}/{version}`, as described in [4.2.1](). @@ -797,7 +797,7 @@ caching as described by [RFC 7234]. ##### 4.5.1 URL to package identifier mappings As part of the [package release metadata]() JSON object, the `repositoryURLs` array can be used to specify URLs associated with a package identifier. -This is one way through which a server can obtain URL to package identifier mappings for this API. +This is one way through which a server can obtain URL to package identifier mappings for this API. A server MAY choose other mechanism(s) for package authors to specify these mappings. @@ -821,19 +821,19 @@ with the following sections: | `metadata` | `application/json` | Additional information about the release. | OPTIONAL | | `metadata-signature` | `application/octet-stream` | The signature of the metadata. | OPTIONAL | -A client MUST set a `Content-Type` header with the value +A client MUST set a `Content-Type` header with the value `multipart/form-data`. `boundary` can be any string. A client MAY use any valid value (e.g., `binary`) for the `Content-Transfer-Encoding` header. -A client SHOULD set the `Content-Length` header with +A client SHOULD set the `Content-Length` header with the total size of the body in bytes. A client SHOULD set the `Accept` header with the value `application/vnd.swift.registry.v1+json`. -A client MUST set a `X-Swift-Package-Signature-Format` header +A client MUST set a `X-Swift-Package-Signature-Format` header with the signature format if the source archive is signed. ```http @@ -1038,7 +1038,7 @@ Content-Language: en { "detail": "invalid JSON provided for release metadata" } -``` +``` ##### 4.6.3. Synchronous and asynchronous publication @@ -1221,13 +1221,13 @@ See [registry.openapi.yaml](./registry.openapi.yaml). ### Appendix B - Package Release Metadata JSON Schema -The `metadata` section of the [create package release request]() +The `metadata` section of the [create package release request]() must be a JSON object of type [`PackageRelease`](), as defined in the JSON schema below.
-Expand to view JSON schema +Expand to view JSON schema ```json { @@ -1241,52 +1241,52 @@ JSON schema below. "type": "object", "properties": { "name": { - "type": "string", + "type": "string", "description": "Name of the author." - }, + }, "email": { "type": "string", "format": "email", "description": "Email address of the author." - }, + }, "description": { - "type": "string", + "type": "string", "description": "A description of the author." }, "organization": { "type": "object", "properties": { "name": { - "type": "string", + "type": "string", "description": "Name of the organization." - }, + }, "email": { "type": "string", - "format": "email", + "format": "email", "description": "Email address of the organization." - }, + }, "description": { - "type": "string", + "type": "string", "description": "A description of the organization." - }, + }, "url": { "type": "string", - "format": "uri", + "format": "uri", "description": "URL of the organization." - }, + }, }, "required": ["name"] - }, + }, "url": { - "type": "string", - "format": "uri", + "type": "string", + "format": "uri", "description": "URL of the author." - }, + }, }, "required": ["name"] }, "description": { - "type": "string", + "type": "string", "description": "A description of the package release." }, "licenseURL": { @@ -1301,7 +1301,7 @@ JSON schema below. }, "readmeURL": { "type": "string", - "format": "uri", + "format": "uri", "description": "URL of the README specifically for the package release or broadly for the package." }, "repositoryURLs": { @@ -1310,7 +1310,7 @@ JSON schema below. "items": { "type": "string", "description": "Code repository URL." - } + } } } } @@ -1386,6 +1386,6 @@ JSON schema below. [thundering herd effect]: https://en.wikipedia.org/wiki/Thundering_herd_problem "Thundering herd problem" [offline cache]: https://yarnpkg.com/features/offline-cache "Offline Cache | Yarn - Package Manager" [XCFramework]: https://developer.apple.com/videos/play/wwdc2019/416/ "WWDC 2019 Session 416: Binary Frameworks in Swift" -[SE-0272]: https://github.com/swiftlang/swift-evolution/blob/master/proposals/0272-swiftpm-binary-dependencies.md "Package Manager Binary Dependencies" +[SE-0272]: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0272-swiftpm-binary-dependencies.md "Package Manager Binary Dependencies" [Swift tools version]: https://github.com/swiftlang/swift-package-manager/blob/9b9bed7eaf0f38eeccd0d8ca06ae08f6689d1c3f/Documentation/Usage.md#swift-tools-version-specification "Swift Tools Version Specification" [ISO 8601]: https://www.iso.org/iso-8601-date-and-time-format.html "ISO 8601 Date and Time Format" diff --git a/Sources/PackageModel/Manifest/TargetDescription.swift b/Sources/PackageModel/Manifest/TargetDescription.swift index d336bedb60a..d704677a2bd 100644 --- a/Sources/PackageModel/Manifest/TargetDescription.swift +++ b/Sources/PackageModel/Manifest/TargetDescription.swift @@ -119,7 +119,7 @@ public struct TargetDescription: Hashable, Encodable, Sendable { /// The exclude patterns. public let exclude: [String] - // FIXME: Kill this. + // FIXME: Terminate this. // /// Returns true if the target type is test. public var isTest: Bool { @@ -140,16 +140,16 @@ public struct TargetDescription: Hashable, Encodable, Sendable { /// The providers of a system library target. public let providers: [SystemPackageProviderDescription]? - + /// The declared capability for a package plugin target. public let pluginCapability: PluginCapability? - + /// Represents the declared capability of a package plugin. public enum PluginCapability: Hashable, Sendable { case buildTool case command(intent: PluginCommandIntent, permissions: [PluginPermission]) } - + public enum PluginCommandIntent: Hashable, Codable, Sendable { case documentationGeneration case sourceCodeFormatting @@ -185,7 +185,7 @@ public struct TargetDescription: Hashable, Encodable, Sendable { /// The binary target checksum. public let checksum: String? - + /// The usages of package plugins by the target. public let pluginUsages: [PluginUsage]? diff --git a/Sources/Workspace/ManifestSigning/Base64URL.swift b/Sources/Workspace/ManifestSigning/Base64URL.swift index bae48bb4c62..fa803b7052e 100644 --- a/Sources/Workspace/ManifestSigning/Base64URL.swift +++ b/Sources/Workspace/ManifestSigning/Base64URL.swift @@ -25,7 +25,7 @@ import Foundation -// Source: https://github.com/vapor/jwt-kit/blob/master/Sources/JWTKit/Utilities/Base64URL.swift +// Source: https://github.com/vapor/jwt-kit/blob/main/Sources/JWTKit/Utilities/Base64URL.swift extension DataProtocol { func base64URLDecodedBytes() -> Data? { diff --git a/Sources/Workspace/ManifestSigning/Signature.swift b/Sources/Workspace/ManifestSigning/Signature.swift index 76e27d45d10..7a7ac509723 100644 --- a/Sources/Workspace/ManifestSigning/Signature.swift +++ b/Sources/Workspace/ManifestSigning/Signature.swift @@ -64,7 +64,7 @@ extension Signature { } } -// Reference: https://github.com/vapor/jwt-kit/blob/master/Sources/JWTKit/JWTSerializer.swift +// Reference: https://github.com/vapor/jwt-kit/blob/main/Sources/JWTKit/JWTSerializer.swift extension Signature { static let rsaSigningPadding = _RSA.Signing.Padding.insecurePKCS1v1_5 @@ -100,7 +100,7 @@ extension Signature { } } -// Reference: https://github.com/vapor/jwt-kit/blob/master/Sources/JWTKit/JWTParser.swift +// Reference: https://github.com/vapor/jwt-kit/blob/main/Sources/JWTKit/JWTParser.swift extension Signature { typealias CertChainValidate = ([Data]) async throws -> [Certificate] diff --git a/Tests/BasicsTests/AsyncProcessTests.swift b/Tests/BasicsTests/AsyncProcessTests.swift index 656831ef3c2..c8eba9c3978 100644 --- a/Tests/BasicsTests/AsyncProcessTests.swift +++ b/Tests/BasicsTests/AsyncProcessTests.swift @@ -425,7 +425,7 @@ final class AsyncProcessTests: XCTestCase { func testAsyncStream() async throws { // rdar://133548796 try XCTSkipIfPlatformCI() - try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8547: 'swift test' was hanging.") + try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8547: 'swift test' was stalled.") let (stdoutStream, stdoutContinuation) = AsyncProcess.ReadableStream.makeStream() let (stderrStream, stderrContinuation) = AsyncProcess.ReadableStream.makeStream() @@ -483,7 +483,7 @@ final class AsyncProcessTests: XCTestCase { func testAsyncStreamHighLevelAPI() async throws { // rdar://133548796 try XCTSkipIfPlatformCI() - try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8547: 'swift test' was hanging.") + try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8547: 'swift test' was stalled.") let result = try await AsyncProcess.popen( scriptName: "echo\(ProcessInfo.batSuffix)", // maps to 'processInputs/echo' script diff --git a/Tests/BuildTests/BuildPlanTests.swift b/Tests/BuildTests/BuildPlanTests.swift index 62abd5aa3db..4370b856710 100644 --- a/Tests/BuildTests/BuildPlanTests.swift +++ b/Tests/BuildTests/BuildPlanTests.swift @@ -623,7 +623,7 @@ class BuildPlanTestCase: BuildSystemProviderTestCase { func testPackageNameFlag() async throws { try XCTSkipIfPlatformCI() // test is disabled because it isn't stable, see rdar://118239206 - try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8547: 'swift test' was hanging.") + try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8547: 'swift test' was stalled.") let isFlagSupportedInDriver = try DriverSupport.checkToolchainDriverFlags( flags: ["package-name"], toolchain: UserToolchain.default, diff --git a/Tests/PackageCollectionsTests/GitHubPackageMetadataProviderTests.swift b/Tests/PackageCollectionsTests/GitHubPackageMetadataProviderTests.swift index d29033ce597..57f6becd591 100644 --- a/Tests/PackageCollectionsTests/GitHubPackageMetadataProviderTests.swift +++ b/Tests/PackageCollectionsTests/GitHubPackageMetadataProviderTests.swift @@ -116,9 +116,9 @@ class GitHubPackageMetadataProviderTests: XCTestCase { XCTAssertEqual(metadata.authors, [PackageCollectionsModel.Package.Author(username: "octocat", url: "https://api.github.com/users/octocat", service: .init(name: "GitHub"))]) - XCTAssertEqual(metadata.readmeURL, "https://raw.githubusercontent.com/octokit/octokit.rb/master/README.md") + XCTAssertEqual(metadata.readmeURL, "https://raw.githubusercontent.com/octokit/octokit.rb/main/README.md") XCTAssertEqual(metadata.license?.type, PackageCollectionsModel.LicenseType.MIT) - XCTAssertEqual(metadata.license?.url, "https://raw.githubusercontent.com/benbalter/gman/master/LICENSE?lab=true") + XCTAssertEqual(metadata.license?.url, "https://raw.githubusercontent.com/benbalter/gman/main/LICENSE?lab=true") XCTAssertEqual(metadata.watchersCount, 80) XCTAssertEqual(metadata.languages, ["Swift", "Shell", "C"]) } diff --git a/Tests/PackageGraphTests/ModulesGraphTests.swift b/Tests/PackageGraphTests/ModulesGraphTests.swift index 1089a3ab30b..ec2e153d31d 100644 --- a/Tests/PackageGraphTests/ModulesGraphTests.swift +++ b/Tests/PackageGraphTests/ModulesGraphTests.swift @@ -1789,7 +1789,7 @@ struct ModulesGraphTests { path: "/Foo", toolsVersion: .v5_2, dependencies: [ - .localSourceControl(path: "/Bar", requirement: .branch("master")), + .localSourceControl(path: "/Bar", requirement: .branch("main")), .localSourceControl(path: "/BizPath", requirement: .exact("1.2.3")), .localSourceControl(path: "/FizPath", requirement: .upToNextMajor(from: "1.1.2")), ], @@ -1872,7 +1872,7 @@ struct ModulesGraphTests { path: "/Foo", toolsVersion: .v5_2, dependencies: [ - .localSourceControl(deprecatedName: "UnBar", path: "/Bar", requirement: .branch("master")), + .localSourceControl(deprecatedName: "UnBar", path: "/Bar", requirement: .branch("main")), ], targets: [ TargetDescription(name: "Foo", dependencies: [.product(name: "BarProduct", package: "UnBar")]), diff --git a/Tests/PackageGraphTests/PubGrubTests.swift b/Tests/PackageGraphTests/PubGrubTests.swift index ba04635930d..7b0c2a13fba 100644 --- a/Tests/PackageGraphTests/PubGrubTests.swift +++ b/Tests/PackageGraphTests/PubGrubTests.swift @@ -837,40 +837,40 @@ final class PubGrubTests: XCTestCase { func testUnversioned4() async throws { try builder.serve("foo", at: .unversioned) - try builder.serve("bar", at: .revision("master"), with: [ + try builder.serve("bar", at: .revision("main"), with: [ "bar": ["foo": (.versionSet(v1Range), .specific(["foo"]))] ]) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ "foo": (.unversioned, .specific(["foo"])), - "bar": (.revision("master"), .specific(["bar"])) + "bar": (.revision("main"), .specific(["bar"])) ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ ("foo", .unversioned), - ("bar", .revision("master")) + ("bar", .revision("main")) ]) } func testUnversioned5() async throws { try builder.serve("foo", at: .unversioned) - try builder.serve("foo", at: .revision("master")) - try builder.serve("bar", at: .revision("master"), with: [ - "bar": ["foo": (.revision("master"), .specific(["foo"]))] + try builder.serve("foo", at: .revision("main")) + try builder.serve("bar", at: .revision("main"), with: [ + "bar": ["foo": (.revision("main"), .specific(["foo"]))] ]) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ "foo": (.unversioned, .specific(["foo"])), - "bar": (.revision("master"), .specific(["bar"])) + "bar": (.revision("main"), .specific(["bar"])) ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ ("foo", .unversioned), - ("bar", .revision("master")) + ("bar", .revision("main")) ]) } @@ -1200,92 +1200,92 @@ final class PubGrubTests: XCTestCase { } func testResolutionWithSimpleBranchBasedDependency() async throws { - try builder.serve("foo", at: .revision("master"), with: ["foo": ["bar": (.versionSet(v1Range), .specific(["bar"]))]]) + try builder.serve("foo", at: .revision("main"), with: ["foo": ["bar": (.versionSet(v1Range), .specific(["bar"]))]]) try builder.serve("bar", at: v1) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "foo": (.revision("master"), .specific(["foo"])), + "foo": (.revision("main"), .specific(["foo"])), "bar": (.versionSet(v1Range), .specific(["bar"])) ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("foo", .revision("master")), + ("foo", .revision("main")), ("bar", .version(v1)) ]) } func testResolutionWithSimpleBranchBasedDependency2() async throws { - try builder.serve("foo", at: .revision("master"), with: ["foo": ["bar": (.versionSet(v1Range), .specific(["bar"]))]]) + try builder.serve("foo", at: .revision("main"), with: ["foo": ["bar": (.versionSet(v1Range), .specific(["bar"]))]]) try builder.serve("bar", at: v1) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "foo": (.revision("master"), .specific(["foo"])), + "foo": (.revision("main"), .specific(["foo"])), ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("foo", .revision("master")), + ("foo", .revision("main")), ("bar", .version(v1)) ]) } func testResolutionWithOverridingBranchBasedDependency() async throws { - try builder.serve("foo", at: .revision("master")) + try builder.serve("foo", at: .revision("main")) try builder.serve("bar", at: v1, with: ["bar": ["foo": (.versionSet(v1Range), .specific(["foo"]))]]) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "foo": (.revision("master"), .specific(["foo"])), + "foo": (.revision("main"), .specific(["foo"])), "bar": (.versionSet(.exact(v1)), .specific(["bar"])), ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("foo", .revision("master")), + ("foo", .revision("main")), ("bar", .version(v1)) ]) } func testResolutionWithOverridingBranchBasedDependency2() async throws { - try builder.serve("foo", at: .revision("master")) + try builder.serve("foo", at: .revision("main")) try builder.serve("bar", at: v1, with: ["bar": ["foo": (.versionSet(v1Range), .specific(["foo"]))]]) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ "bar": (.versionSet(.exact(v1)), .specific(["bar"])), - "foo": (.revision("master"), .specific(["foo"])), + "foo": (.revision("main"), .specific(["foo"])), ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("foo", .revision("master")), + ("foo", .revision("main")), ("bar", .version(v1)) ]) } func testResolutionWithOverridingBranchBasedDependency3() async throws { - try builder.serve("foo", at: .revision("master"), with: ["foo": ["bar": (.revision("master"), .specific(["bar"]))]]) + try builder.serve("foo", at: .revision("main"), with: ["foo": ["bar": (.revision("main"), .specific(["bar"]))]]) - try builder.serve("bar", at: .revision("master")) + try builder.serve("bar", at: .revision("main")) try builder.serve("bar", at: v1) - try builder.serve("baz", at: .revision("master"), with: ["baz": ["bar": (.versionSet(v1Range), .specific(["bar"]))]]) + try builder.serve("baz", at: .revision("main"), with: ["baz": ["bar": (.versionSet(v1Range), .specific(["bar"]))]]) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "foo": (.revision("master"), .specific(["foo"])), - "baz": (.revision("master"), .specific(["baz"])), + "foo": (.revision("main"), .specific(["foo"])), + "baz": (.revision("main"), .specific(["baz"])), ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("foo", .revision("master")), - ("bar", .revision("master")), - ("baz", .revision("master")), + ("foo", .revision("main")), + ("bar", .revision("main")), + ("baz", .revision("main")), ]) } @@ -1294,7 +1294,7 @@ final class PubGrubTests: XCTestCase { let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "foo": (.revision("master"), .specific(["foo"])) + "foo": (.revision("main"), .specific(["foo"])) ]) let result = await resolver.solve(constraints: dependencies) @@ -1302,27 +1302,27 @@ final class PubGrubTests: XCTestCase { } func testResolutionWithRevisionConflict() async throws { - try builder.serve("foo", at: .revision("master"), with: ["foo": ["bar": (.revision("master"), .specific(["bar"]))]]) + try builder.serve("foo", at: .revision("main"), with: ["foo": ["bar": (.revision("main"), .specific(["bar"]))]]) try builder.serve("bar", at: .version(v1)) - try builder.serve("bar", at: .revision("master")) + try builder.serve("bar", at: .revision("main")) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ "bar": (.versionSet(v1Range), .specific(["bar"])), - "foo": (.revision("master"), .specific(["foo"])), + "foo": (.revision("main"), .specific(["foo"])), ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("foo", .revision("master")), - ("bar", .revision("master")), + ("foo", .revision("main")), + ("bar", .revision("main")), ]) } func testBranchOverriding3() async throws { try builder.serve("swift-nio", at: v1) - try builder.serve("swift-nio", at: .revision("master")) - try builder.serve("swift-nio-ssl", at: .revision("master"), with: [ + try builder.serve("swift-nio", at: .revision("main")) + try builder.serve("swift-nio-ssl", at: .revision("main"), with: [ "swift-nio-ssl": ["swift-nio": (.versionSet(v2Range), .specific(["swift-nio"]))], ]) try builder.serve("foo", at: "1.0.0", with: [ @@ -1332,28 +1332,28 @@ final class PubGrubTests: XCTestCase { let resolver = builder.create() let dependencies = try builder.create(dependencies: [ "foo": (.versionSet(v1Range), .specific(["foo"])), - "swift-nio": (.revision("master"), .specific(["swift-nio"])), - "swift-nio-ssl": (.revision("master"), .specific(["swift-nio-ssl"])), + "swift-nio": (.revision("main"), .specific(["swift-nio"])), + "swift-nio-ssl": (.revision("main"), .specific(["swift-nio-ssl"])), ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("swift-nio-ssl", .revision("master")), - ("swift-nio", .revision("master")), + ("swift-nio-ssl", .revision("main")), + ("swift-nio", .revision("main")), ("foo", .version(v1)) ]) } func testBranchOverriding4() async throws { try builder.serve("swift-nio", at: v1) - try builder.serve("swift-nio", at: .revision("master")) - try builder.serve("swift-nio-ssl", at: .revision("master"), with: [ + try builder.serve("swift-nio", at: .revision("main")) + try builder.serve("swift-nio-ssl", at: .revision("main"), with: [ "swift-nio-ssl": ["swift-nio": (.versionSet(v2Range), .specific(["swift-nio"]))], ]) - try builder.serve("nio-postgres", at: .revision("master"), with: [ + try builder.serve("nio-postgres", at: .revision("main"), with: [ "nio-postgres": [ - "swift-nio": (.revision("master"), .specific(["swift-nio"])), - "swift-nio-ssl": (.revision("master"), .specific(["swift-nio-ssl"])), + "swift-nio": (.revision("main"), .specific(["swift-nio"])), + "swift-nio-ssl": (.revision("main"), .specific(["swift-nio-ssl"])), ] ]) try builder.serve("http-client", at: v1, with: [ @@ -1368,16 +1368,16 @@ final class PubGrubTests: XCTestCase { let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "nio-postgres": (.revision("master"), .specific(["nio-postgres"])), + "nio-postgres": (.revision("main"), .specific(["nio-postgres"])), "http-client": (.versionSet(v1Range), .specific(["https-client"])), "boring-ssl": (.versionSet(v1Range), .specific(["boring-ssl"])), ]) let result = await resolver.solve(constraints: dependencies) AssertResult(result, [ - ("swift-nio-ssl", .revision("master")), - ("swift-nio", .revision("master")), - ("nio-postgres", .revision("master")), + ("swift-nio-ssl", .revision("main")), + ("swift-nio", .revision("main")), + ("nio-postgres", .revision("main")), ("http-client", .version(v1)), ("boring-ssl", .version(v1)), ]) @@ -1385,7 +1385,7 @@ final class PubGrubTests: XCTestCase { func testNonVersionDependencyInVersionDependency2() async throws { try builder.serve("foo", at: v1_1, with: [ - "foo": ["bar": (.revision("master"), .specific(["bar"]))] + "foo": ["bar": (.revision("main"), .specific(["bar"]))] ]) try builder.serve("foo", at: v1) let resolver = builder.create() @@ -1491,16 +1491,16 @@ final class PubGrubTests: XCTestCase { // This test ensures that we get the SHA listed in Package.resolved for branch-based // dependencies. try builder.serve("a", at: .revision("develop-sha-1")) - try builder.serve("b", at: .revision("master-sha-2")) + try builder.serve("b", at: .revision("main-sha-2")) let dependencies = try builder.create(dependencies: [ "a": (.revision("develop"), .specific(["a"])), - "b": (.revision("master"), .specific(["b"])), + "b": (.revision("main"), .specific(["b"])), ]) let resolvedPackagesStore = try builder.create(resolvedPackages: [ "a": (.branch(name: "develop", revision: "develop-sha-1"), .specific(["a"])), - "b": (.branch(name: "master", revision: "master-sha-2"), .specific(["b"])), + "b": (.branch(name: "main", revision: "main-sha-2"), .specific(["b"])), ]) let resolver = builder.create(resolvedPackages: resolvedPackagesStore.resolvedPackages) @@ -1508,7 +1508,7 @@ final class PubGrubTests: XCTestCase { AssertResult(result, [ ("a", .revision("develop-sha-1", branch: "develop")), - ("b", .revision("master-sha-2", branch: "master")), + ("b", .revision("main-sha-2", branch: "main")), ]) } @@ -2420,14 +2420,14 @@ final class PubGrubDiagnosticsTests: XCTestCase { func testUnversioned6() async throws { try builder.serve("foo", at: .unversioned) - try builder.serve("bar", at: .revision("master"), with: [ + try builder.serve("bar", at: .revision("main"), with: [ "bar": ["foo": (.unversioned, .specific(["foo"]))] ]) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "bar": (.revision("master"), .specific(["bar"])) + "bar": (.revision("main"), .specific(["bar"])) ]) let result = await resolver.solve(constraints: dependencies) @@ -2435,28 +2435,28 @@ final class PubGrubDiagnosticsTests: XCTestCase { } func testResolutionWithOverridingBranchBasedDependency4() async throws { - try builder.serve("foo", at: .revision("master"), with: ["foo": ["bar": (.revision("master"), .specific(["bar"]))]]) + try builder.serve("foo", at: .revision("main"), with: ["foo": ["bar": (.revision("main"), .specific(["bar"]))]]) - try builder.serve("bar", at: .revision("master")) + try builder.serve("bar", at: .revision("main")) try builder.serve("bar", at: v1) - try builder.serve("baz", at: .revision("master"), with: ["baz": ["bar": (.revision("develop"), .specific(["baz"]))]]) + try builder.serve("baz", at: .revision("main"), with: ["baz": ["bar": (.revision("develop"), .specific(["baz"]))]]) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ - "foo": (.revision("master"), .specific(["foo"])), - "baz": (.revision("master"), .specific(["baz"])), + "foo": (.revision("main"), .specific(["foo"])), + "baz": (.revision("main"), .specific(["baz"])), ]) let result = await resolver.solve(constraints: dependencies) - XCTAssertEqual(result.errorMsg, "bar is required using two different revision-based requirements (master and develop), which is not supported") + XCTAssertEqual(result.errorMsg, "bar is required using two different revision-based requirements (main and develop), which is not supported") } func testNonVersionDependencyInVersionDependency1() async throws { try builder.serve("foo", at: v1_1, with: [ - "foo": ["bar": (.revision("master"), .specific(["bar"]))] + "foo": ["bar": (.revision("main"), .specific(["bar"]))] ]) - try builder.serve("bar", at: .revision("master")) + try builder.serve("bar", at: .revision("main")) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ @@ -2489,15 +2489,15 @@ final class PubGrubDiagnosticsTests: XCTestCase { func testNonVersionDependencyInVersionDependency3() async throws { try builder.serve("foo", at: "1.0.0-beta.1", with: [ - "foo": ["bar": (.revision("master"), .specific(["bar"]))] + "foo": ["bar": (.revision("main"), .specific(["bar"]))] ]) try builder.serve("foo", at: "1.0.0-beta.2", with: [ - "foo": ["bar": (.revision("master"), .specific(["bar"]))] + "foo": ["bar": (.revision("main"), .specific(["bar"]))] ]) try builder.serve("foo", at: "1.0.0-beta.3", with: [ - "foo": ["bar": (.revision("master"), .specific(["bar"]))] + "foo": ["bar": (.revision("main"), .specific(["bar"]))] ]) - try builder.serve("bar", at: .revision("master")) + try builder.serve("bar", at: .revision("main")) let resolver = builder.create() let dependencies = try builder.create(dependencies: [ diff --git a/Tests/PackageLoadingTests/PD_4_0_LoadingTests.swift b/Tests/PackageLoadingTests/PD_4_0_LoadingTests.swift index b3a50c22c7c..fd29edf26cc 100644 --- a/Tests/PackageLoadingTests/PD_4_0_LoadingTests.swift +++ b/Tests/PackageLoadingTests/PD_4_0_LoadingTests.swift @@ -295,7 +295,7 @@ final class PackageDescription4_0LoadingTests: PackageDescriptionLoadingTests { name: "Foo", dependencies: [ .package(url: "/foo1", version: "1.0.0"), - .package(url: "/foo2", branch: "master"), + .package(url: "/foo2", branch: "main"), .package(url: "/foo3", revision: "rev"), .package(url: "/foo4", range: "1.0.0"..<"1.5.0"), ] diff --git a/Tests/PackageLoadingTests/PD_4_2_LoadingTests.swift b/Tests/PackageLoadingTests/PD_4_2_LoadingTests.swift index 1059a81d4a3..2f54e2a14de 100644 --- a/Tests/PackageLoadingTests/PD_4_2_LoadingTests.swift +++ b/Tests/PackageLoadingTests/PD_4_2_LoadingTests.swift @@ -258,7 +258,7 @@ final class PackageDescription4_2LoadingTests: PackageDescriptionLoadingTests { .package(path: "\(AbsolutePath("/path/to/foo4").escapedPathString)"), .package(url: "\(AbsolutePath("/foo5").escapedPathString)", .exact("1.2.3")), .package(url: "\(AbsolutePath("/foo6").escapedPathString)", "1.2.3"..<"2.0.0"), - .package(url: "\(AbsolutePath("/foo7").escapedPathString)", .branch("master")), + .package(url: "\(AbsolutePath("/foo7").escapedPathString)", .branch("main")), .package(url: "\(AbsolutePath("/foo8").escapedPathString)", .upToNextMinor(from: "1.3.4")), .package(url: "\(AbsolutePath("/foo9").escapedPathString)", .upToNextMajor(from: "1.3.4")), .package(path: "~/path/to/foo10"), @@ -293,7 +293,7 @@ final class PackageDescription4_2LoadingTests: PackageDescriptionLoadingTests { XCTAssertEqual(deps["foo5"], .localSourceControl(path: "/foo5", requirement: .exact("1.2.3"))) XCTAssertEqual(deps["foo6"], .localSourceControl(path: "/foo6", requirement: .range("1.2.3"..<"2.0.0"))) - XCTAssertEqual(deps["foo7"], .localSourceControl(path: "/foo7", requirement: .branch("master"))) + XCTAssertEqual(deps["foo7"], .localSourceControl(path: "/foo7", requirement: .branch("main"))) XCTAssertEqual(deps["foo8"], .localSourceControl(path: "/foo8", requirement: .upToNextMinor(from: "1.3.4"))) XCTAssertEqual(deps["foo9"], .localSourceControl(path: "/foo9", requirement: .upToNextMajor(from: "1.3.4"))) diff --git a/Tests/PackageLoadingTests/ToolsVersionParserTests.swift b/Tests/PackageLoadingTests/ToolsVersionParserTests.swift index c7c6b05778d..fc92d8a00ba 100644 --- a/Tests/PackageLoadingTests/ToolsVersionParserTests.swift +++ b/Tests/PackageLoadingTests/ToolsVersionParserTests.swift @@ -349,7 +349,7 @@ final class ToolsVersionParserTests: XCTestCase { "/// We are the knights who say 'Ni!'", // Missing version specifiers are diagnosed before backward-compatibility checks. "\r\n//\tswift-tools-version:", - "\n\r///The swifts hung in the sky in much the same way that bricks don't.\u{85}", + "\n\r///The swifts stalled in the sky in much the same way that bricks don't.\u{85}", ] for manifestSnippet in manifestSnippetsWithoutVersionSpecifier { diff --git a/Tests/SourceControlTests/GitRepositoryTests.swift b/Tests/SourceControlTests/GitRepositoryTests.swift index b9ee3871aaf..53ebb0dccf3 100644 --- a/Tests/SourceControlTests/GitRepositoryTests.swift +++ b/Tests/SourceControlTests/GitRepositoryTests.swift @@ -63,7 +63,7 @@ class GitRepositoryTests: XCTestCase { /// Test the basic provider functions. func testProvider() async throws { // Skipping all tests that call git on Windows. - // We have a hang in CI when running in parallel. + // We have a test stall in CI when running in parallel. try XCTSkipOnWindows(because: "https://github.com/swiftlang/swift-package-manager/issues/8564", skipSelfHostedCI: true) try await testWithTemporaryDirectory { path in let testRepoPath = path.appending("test-repo") @@ -145,8 +145,10 @@ class GitRepositoryTests: XCTestCase { // Check hash resolution. let repo = GitRepository(path: testRepoPath) - XCTAssertEqual(try repo.resolveHash(treeish: "1.0", type: "commit"), - try repo.resolveHash(treeish: "master")) + XCTAssertEqual( + try repo.resolveHash(treeish: "1.0", type: "commit"), + try repo.resolveHash(treeish: "main"), + ) // Get the initial commit. let initialCommitHash = try repo.resolveHash(treeish: "a8b9fcb") diff --git a/Tests/SourceControlTests/Inputs/TestRepo.tgz b/Tests/SourceControlTests/Inputs/TestRepo.tgz index 791138453fa..cc17517df2c 100644 Binary files a/Tests/SourceControlTests/Inputs/TestRepo.tgz and b/Tests/SourceControlTests/Inputs/TestRepo.tgz differ diff --git a/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift b/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift index e73fb132090..ce6fddb800d 100644 --- a/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift +++ b/Tests/WorkspaceTests/SourceControlPackageContainerTests.swift @@ -531,7 +531,7 @@ final class SourceControlPackageContainerTests: XCTestCase { try packageRepo.commit(message: "Initial") try packageRepo.tag(name: "1.0.0") - // Rename the `master` branch to `main`. + // Rename the default branch to `main`. try await AsyncProcess.checkNonZeroExit(args: Git.tool, "-C", packageDir.pathString, "branch", "-m", "main") // Create a repository manager for it. @@ -563,13 +563,13 @@ final class SourceControlPackageContainerTests: XCTestCase { let packageRef = PackageReference.localSourceControl(identity: PackageIdentity(path: packageDir), path: packageDir) let container = try await containerProvider.getContainer(for: packageRef) as! SourceControlPackageContainer - // Simulate accessing a fictitious dependency on the `master` branch, and check that we get back the expected error. - do { _ = try await container.getDependencies(at: "master", productFilter: .everything) } + // Simulate accessing a fictitious dependency on the `mater` branch, and check that we get back the expected error. + do { _ = try await container.getDependencies(at: "mater", productFilter: .everything) } catch let error as SourceControlPackageContainer.GetDependenciesError { // We expect to get an error message that mentions main. - XCTAssertMatch(error.description, .and(.prefix("could not find a branch named ‘master’"), .suffix("(did you mean ‘main’?)"))) + XCTAssertMatch(error.description,.prefix("could not find a branch named ‘mater’")) XCTAssertMatch(error.repository.description, .suffix("SomePackage")) - XCTAssertMatch(error.reference, "master") + XCTAssertMatch(error.reference, "mater") } // Simulate accessing a fictitious dependency on some random commit that doesn't exist, and check that we get back the expected error. diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index ea2974d13c0..73db78f47c6 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -1099,7 +1099,7 @@ final class WorkspaceTests: XCTestCase { let bPath = RelativePath("B") let cPath = RelativePath("C") let v1Requirement: SourceControlRequirement = .range("1.0.0" ..< "2.0.0") - let branchRequirement: SourceControlRequirement = .branch("master") + let branchRequirement: SourceControlRequirement = .branch("main") let v1_5 = CheckoutState.version("1.0.5", revision: Revision(identifier: "hello")) let workspace = try await MockWorkspace( @@ -1157,7 +1157,7 @@ final class WorkspaceTests: XCTestCase { XCTAssertEqual(result.result, .required(reason: .packageRequirementChange( package: cRef, state: .sourceControlCheckout(v1_5), - requirement: .revision("master") + requirement: .revision("main") ))) } @@ -1217,7 +1217,7 @@ final class WorkspaceTests: XCTestCase { let fs = InMemoryFileSystem() let bPath = RelativePath("B") let v1Requirement: SourceControlRequirement = .range("1.0.0" ..< "2.0.0") - let masterRequirement: SourceControlRequirement = .branch("master") + let masterRequirement: SourceControlRequirement = .branch("main") let v1_5 = CheckoutState.version("1.0.5", revision: Revision(identifier: "hello")) let workspace = try await MockWorkspace( @@ -1275,7 +1275,7 @@ final class WorkspaceTests: XCTestCase { XCTAssertEqual(result.result, .required(reason: .packageRequirementChange( package: cRef, state: .fileSystem(cPackagePath), - requirement: .revision("master") + requirement: .revision("main") ))) } @@ -1353,7 +1353,7 @@ final class WorkspaceTests: XCTestCase { let cPath = RelativePath("C") let v1Requirement: SourceControlRequirement = .range("1.0.0" ..< "2.0.0") let v1_5 = CheckoutState.version("1.0.5", revision: Revision(identifier: "hello")) - let master = CheckoutState.branch(name: "master", revision: Revision(identifier: "master")) + let main = CheckoutState.branch(name: "main", revision: Revision(identifier: "main")) let workspace = try await MockWorkspace( sandbox: sandbox, @@ -1398,10 +1398,10 @@ final class WorkspaceTests: XCTestCase { ) try await workspace.set( - resolvedPackages: [bRef: v1_5, cRef: master], + resolvedPackages: [bRef: v1_5, cRef: main], managedDependencies: [ bPackagePath: .sourceControlCheckout(packageRef: bRef, state: v1_5, subpath: bPath), - cPackagePath: .sourceControlCheckout(packageRef: cRef, state: master, subpath: cPath), + cPackagePath: .sourceControlCheckout(packageRef: cRef, state: main, subpath: cPath), ] ) @@ -1409,7 +1409,7 @@ final class WorkspaceTests: XCTestCase { XCTAssertNoDiagnostics(result.diagnostics) XCTAssertEqual(result.result, .required(reason: .packageRequirementChange( package: cRef, - state: .sourceControlCheckout(master), + state: .sourceControlCheckout(main), requirement: .unversioned ))) } @@ -5644,7 +5644,7 @@ final class WorkspaceTests: XCTestCase { roots: [ MockPackage( name: "Baz", - path: "Overridden/bazzz-master", + path: "Overridden/bazzz-default", targets: [ MockTarget(name: "Baz"), ], @@ -5672,11 +5672,11 @@ final class WorkspaceTests: XCTestCase { .sourceControl(path: "./bazzz", requirement: .exact("1.0.0"), products: .specific(["Baz"])), ] - try await workspace.checkPackageGraphFailure(roots: ["Overridden/bazzz-master"], deps: deps) { diagnostics in + try await workspace.checkPackageGraphFailure(roots: ["Overridden/bazzz-default"], deps: deps) { diagnostics in testDiagnostics(diagnostics) { result in result.check( diagnostic: .equal( - "unable to override package 'Baz' because its identity 'bazzz' doesn't match override's identity (directory name) 'bazzz-master'" + "unable to override package 'Baz' because its identity 'bazzz' doesn't match override's identity (directory name) 'bazzz-default'" ), severity: .error ) @@ -5922,7 +5922,7 @@ final class WorkspaceTests: XCTestCase { ], products: [], dependencies: [ - .sourceControl(path: "./Foo", requirement: .branch("master")), + .sourceControl(path: "./Foo", requirement: .branch("main")), .sourceControl(path: "./Baz", requirement: .upToNextMajor(from: "1.0.0")), ] ), @@ -5937,9 +5937,9 @@ final class WorkspaceTests: XCTestCase { MockProduct(name: "Foo", modules: ["Foo"]), ], dependencies: [ - .sourceControl(path: "./Bar", requirement: .branch("master")), + .sourceControl(path: "./Bar", requirement: .branch("main")), ], - versions: ["master", nil] + versions: ["main", nil] ), MockPackage( name: "Bar", @@ -5949,7 +5949,7 @@ final class WorkspaceTests: XCTestCase { products: [ MockProduct(name: "Bar", modules: ["Bar"]), ], - versions: ["master", "1.0.0", nil] + versions: ["main", "1.0.0", nil] ), MockPackage( name: "Baz", @@ -5972,8 +5972,8 @@ final class WorkspaceTests: XCTestCase { XCTAssertNoDiagnostics(diagnostics) } await workspace.checkManagedDependencies { result in - result.check(dependency: "foo", at: .checkout(.branch("master"))) - result.check(dependency: "bar", at: .checkout(.branch("master"))) + result.check(dependency: "foo", at: .checkout(.branch("main"))) + result.check(dependency: "bar", at: .checkout(.branch("main"))) result.check(dependency: "baz", at: .checkout(.version("1.0.0"))) } @@ -6002,7 +6002,7 @@ final class WorkspaceTests: XCTestCase { } await workspace.checkManagedDependencies { result in result.check(dependency: "foo", at: .edited(nil)) - result.check(dependency: "bar", at: .checkout(.branch("master"))) + result.check(dependency: "bar", at: .checkout(.branch("main"))) result.check(dependency: "baz", at: .checkout(.version("1.0.0"))) } XCTAssertNoMatch(workspace.delegate.events, [.equal("will resolve dependencies")]) diff --git a/Tests/XCBuildSupportTests/PIFBuilderTests.swift b/Tests/XCBuildSupportTests/PIFBuilderTests.swift index d3ca5fc8bbe..d312562d262 100644 --- a/Tests/XCBuildSupportTests/PIFBuilderTests.swift +++ b/Tests/XCBuildSupportTests/PIFBuilderTests.swift @@ -65,7 +65,7 @@ final class PIFBuilderTests: XCTestCase { path: "/A", toolsVersion: .v5_2, dependencies: [ - .localSourceControl(path: "/B", requirement: .branch("master")), + .localSourceControl(path: "/B", requirement: .branch("main")), ], products: [ .init(name: "alib", type: .library(.static), targets: ["A2"]), @@ -138,7 +138,7 @@ final class PIFBuilderTests: XCTestCase { defaultLocalization: "fr", toolsVersion: .v5_2, dependencies: [ - .localSourceControl(path: "/Bar", requirement: .branch("master")), + .localSourceControl(path: "/Bar", requirement: .branch("main")), ], targets: [ .init(name: "foo", dependencies: [.product(name: "BarLib", package: "Bar")]), @@ -445,7 +445,7 @@ final class PIFBuilderTests: XCTestCase { toolsVersion: .v5_2, swiftLanguageVersions: [.v4_2, .v5], dependencies: [ - .localSourceControl(path: "/Bar", requirement: .branch("master")), + .localSourceControl(path: "/Bar", requirement: .branch("main")), ], targets: [ .init(name: "foo", dependencies: [ @@ -806,7 +806,7 @@ final class PIFBuilderTests: XCTestCase { toolsVersion: .v5_2, swiftLanguageVersions: [.v4_2, .v5], dependencies: [ - .localSourceControl(path: "/Bar", requirement: .branch("master")), + .localSourceControl(path: "/Bar", requirement: .branch("main")), ], targets: [ .init(name: "FooTests", dependencies: [ @@ -1125,7 +1125,7 @@ final class PIFBuilderTests: XCTestCase { toolsVersion: .v5_2, swiftLanguageVersions: [.v4_2, .v5], dependencies: [ - .localSourceControl(path: "/Bar", requirement: .branch("master")), + .localSourceControl(path: "/Bar", requirement: .branch("main")), ], products: [ .init(name: "FooLib1", type: .library(.static), targets: ["FooLib1"]), @@ -1337,7 +1337,7 @@ final class PIFBuilderTests: XCTestCase { cxxLanguageStandard: "c++14", swiftLanguageVersions: [.v4_2, .v5], dependencies: [ - .localSourceControl(path: "/Bar", requirement: .branch("master")), + .localSourceControl(path: "/Bar", requirement: .branch("main")), ], targets: [ .init(name: "FooLib1", dependencies: ["SystemLib", "FooLib2"]), diff --git a/Utilities/bootstrap b/Utilities/bootstrap index 14219d6374b..b09242f9742 100755 --- a/Utilities/bootstrap +++ b/Utilities/bootstrap @@ -883,7 +883,7 @@ def get_llbuild_source_path(args): llbuild_path = os.path.join(args.project_root, "..", "llbuild") if os.path.exists(llbuild_path): return llbuild_path - logging.info("clone llbuild next to swiftpm directory; see development docs: https://github.com/swiftlang/swift-package-manager/blob/master/Documentation/Contributing.md") + logging.info("clone llbuild next to swiftpm directory; see development docs: https://github.com/swiftlang/swift-package-manager/blob/main/Documentation/Contributing.md") logging.error("unable to find llbuild source directory at %s", llbuild_path) raise BinaryNotFound(tool="llbuild", path=llbuild_path)