Skip to content

Commit 78c04e2

Browse files
Merge pull request #3030 from practicalswift/normalization
[gardening] Remove invisible characters (^H and ^P). Normalize use of ', * and ".
2 parents 7fad5b8 + b43a26f commit 78c04e2

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

stdlib/public/SDK/Foundation/CharacterSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
182182
return CharacterSet(reference: NSCharacterSet.alphanumerics() as NSCharacterSet)
183183
}
184184

185-
/// Returns a character set containing individual Unicode characters that can also be represented as composed character sequences (such as for letters with accents), by the definition of standard decomposition in version 3.2 of the Unicode character encoding standard.
185+
/// Returns a character set containing individual Unicode characters that can also be represented as composed character sequences (such as for letters with accents), by the definition of "standard decomposition" in version 3.2 of the Unicode character encoding standard.
186186
public static var decomposables : CharacterSet {
187187
return CharacterSet(reference: NSCharacterSet.decomposables() as NSCharacterSet)
188188
}

stdlib/public/SDK/Foundation/Date.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
6464
/**
6565
Returns the interval between the date object and 00:00:00 UTC on 1 January 2001.
6666

67-
This propertys value is negative if the date object is earlier than the systems absolute reference date (00:00:00 UTC on 1 January 2001).
67+
This property's value is negative if the date object is earlier than the system's absolute reference date (00:00:00 UTC on 1 January 2001).
6868
*/
6969
public var timeIntervalSinceReferenceDate: TimeInterval {
7070
return _time
@@ -88,7 +88,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
8888
/**
8989
The time interval between the date and the current date and time.
9090

91-
If the date is earlier than the current date and time, the this propertys value is negative.
91+
If the date is earlier than the current date and time, the this property's value is negative.
9292

9393
- SeeAlso: `timeIntervalSince(_:)`
9494
- SeeAlso: `timeIntervalSince1970`
@@ -101,7 +101,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
101101
/**
102102
The interval between the date object and 00:00:00 UTC on 1 January 1970.
103103

104-
This propertys value is negative if the date object is earlier than 00:00:00 UTC on 1 January 1970.
104+
This property's value is negative if the date object is earlier than 00:00:00 UTC on 1 January 1970.
105105

106106
- SeeAlso: `timeIntervalSince(_:)`
107107
- SeeAlso: `timeIntervalSinceNow`
@@ -179,7 +179,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
179179

180180
- Parameter locale: A `Locale` object. If you pass `nil`, `NSDate` formats the date in the same way as the `description` property.
181181

182-
- Returns: A string representation of the receiver, using the given locale, or if the locale argument is `nil`, in the international format `YYYY-MM-DD HH:MM:SS ±HHMM`, where `±HHMM` represents the time zone offset in hours and minutes from UTC (for example, `2001-03-24 10:45:32 +0600`)
182+
- Returns: A string representation of the receiver, using the given locale, or if the locale argument is `nil`, in the international format `YYYY-MM-DD HH:MM:SS ±HHMM`, where `±HHMM` represents the time zone offset in hours and minutes from UTC (for example, "`2001-03-24 10:45:32 +0600`")
183183
*/
184184
public func description(with locale : Locale?) -> String {
185185
return NSDate(timeIntervalSinceReferenceDate: _time).description(with: locale)

stdlib/public/SDK/Foundation/IndexSet.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ public struct IndexSet : ReferenceConvertible, Equatable, BidirectionalCollectio
704704
}
705705
}
706706

707-
/// Iterate two index sets on the boundaries of their ranges. This is where all of the interesting stuff happens for exclusive or, intersect, etc.
707+
/// Iterate two index sets on the boundaries of their ranges. This is where all of the interesting stuff happens for exclusive or, intersect, etc.
708708
private struct IndexSetBoundaryIterator : IteratorProtocol {
709709
private typealias Element = IndexSet.Element
710710

stdlib/public/SDK/Foundation/URL.swift

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ public struct URLResourceValues {
275275

276276
/// The document identifier -- a value assigned by the kernel to a document (which can be either a file or directory) and is used to identify the document regardless of where it gets moved on a volume.
277277
///
278-
/// The document identifier survives "safe save operations; i.e it is sticky to the path it was assigned to (`replaceItem(at:,withItemAt:,backupItemName:,options:,resultingItem:) throws` is the preferred safe-save API). The document identifier is persistent across system restarts. The document identifier is not transferred when the file is copied. Document identifiers are only unique within a single volume. This property is not supported by all volumes.
278+
/// The document identifier survives "safe save" operations; i.e it is sticky to the path it was assigned to (`replaceItem(at:,withItemAt:,backupItemName:,options:,resultingItem:) throws` is the preferred safe-save API). The document identifier is persistent across system restarts. The document identifier is not transferred when the file is copied. Document identifiers are only unique within a single volume. This property is not supported by all volumes.
279279
@available(OSX 10.10, iOS 8.0, *)
280280
public var documentIdentifier: Int? { return _get(.documentIdentifierKey) }
281281

@@ -471,7 +471,7 @@ public struct URLResourceValues {
471471
/**
472472
A URL is a type that can potentially contain the location of a resource on a remote server, the path of a local file on disk, or even an arbitrary piece of encoded data.
473473

474-
You can construct URLs and access their parts. For URLs that represent local files, you can also manipulate properties of those files directly, such as changing the files last modification date. Finally, you can pass URLs to other APIs to retrieve the contents of those URLs. For example, you can use the URLSession classes to access the contents of remote resources, as described in URL Session Programming Guide.
474+
You can construct URLs and access their parts. For URLs that represent local files, you can also manipulate properties of those files directly, such as changing the file's last modification date. Finally, you can pass URLs to other APIs to retrieve the contents of those URLs. For example, you can use the URLSession classes to access the contents of remote resources, as described in URL Session Programming Guide.
475475

476476
URLs are the preferred way to refer to local files. Most objects that read data from or write data to a file have methods that accept a URL instead of a pathname as the file reference. For example, you can get the contents of a local file URL as `String` by calling `func init(contentsOf:encoding) throws`, or as a `Data` by calling `func init(contentsOf:options) throws`.
477477
*/
@@ -673,7 +673,7 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable {
673673

674674
/// Returns a file reference URL that refers to the same resource as a specified file URL.
675675
///
676-
/// File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This form of file URL remains valid when the file system path of the URLs underlying resource changes. An error will occur if the url parameter is not a file URL. File reference URLs cannot be created to file system objects which do not exist or are not reachable. In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL path. A file reference URL's path should never be persistently stored because is not valid across system restarts, and across remounts of volumes -- if you want to create a persistent reference to a file system object, use a bookmark.
676+
/// File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This form of file URL remains valid when the file system path of the URL's underlying resource changes. An error will occur if the url parameter is not a file URL. File reference URLs cannot be created to file system objects which do not exist or are not reachable. In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL path. A file reference URL's path should never be persistently stored because is not valid across system restarts, and across remounts of volumes -- if you want to create a persistent reference to a file system object, use a bookmark.
677677
/// - seealso: func bookmarkData(options: BookmarkCreationOptions = [], includingResourceValuesForKeys keys: Set<URLResourceKey>? = nil, relativeTo url: URL? = nil) throws -> Data
678678
public func fileReferenceURL() throws -> URL {
679679
if let result = _url.fileReferenceURL().map({ URL(reference: $0 as NSURL) }) {
@@ -711,12 +711,12 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable {
711711
// TODO: Use URLComponents to handle an empty-path case
712712
/*
713713
URLByAppendingPathComponent can return nil if:
714-
the URL does not have a path component. (see note 1)
715-
a mutable copy of the URLs string could not be created.
716-
a percent-encoded string of the new path component could not created using the same encoding as the URLs string. (see note 2)
717-
a new URL object could not be created with the modified URL string.
714+
* the URL does not have a path component. (see note 1)
715+
* a mutable copy of the URLs string could not be created.
716+
* a percent-encoded string of the new path component could not created using the same encoding as the URL's string. (see note 2)
717+
* a new URL object could not be created with the modified URL string.
718718

719-
Note 1: If NS/CFURL parsed URLs correctly, this would not occur because URL strings always have a path component. For example, the URL <mailto:[email protected]> should be parsed as Scheme=mailto, and Path= [email protected]". Instead, CFURL returns false for CFURLCanBeDecomposed(), says Scheme=mailto, Path=nil, and ResourceSpecifier=[email protected]. rdar://problem/15060399
719+
Note 1: If NS/CFURL parsed URLs correctly, this would not occur because URL strings always have a path component. For example, the URL <mailto:[email protected]> should be parsed as Scheme="mailto", and Path= "[email protected]". Instead, CFURL returns false for CFURLCanBeDecomposed(), says Scheme="mailto", Path=nil, and ResourceSpecifier="[email protected]". rdar://problem/15060399
720720

721721
Note 2: CFURLCreateWithBytes() and CFURLCreateAbsoluteURLWithBytes() allow URLs to be created with an array of bytes and a CFStringEncoding. All other CFURL functions and URL methods which create URLs use kCFStringEncodingUTF8/NSUTF8StringEncoding. So, the encoding passed to CFURLCreateWithBytes/CFURLCreateAbsoluteURLWithBytes might prevent the percent-encoding of the new path component or path extension.
722722
*/
@@ -742,10 +742,10 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable {
742742
public func deletingLastPathComponent() throws -> URL {
743743
/*
744744
URLByDeletingLastPathComponent can return nil if:
745-
the URL is a file reference URL which cannot be resolved back to a path.
746-
the URL does not have a path component. (see note 1)
747-
a mutable copy of the URLs string could not be created.
748-
a new URL object could not be created with the modified URL string.
745+
* the URL is a file reference URL which cannot be resolved back to a path.
746+
* the URL does not have a path component. (see note 1)
747+
* a mutable copy of the URLs string could not be created.
748+
* a new URL object could not be created with the modified URL string.
749749
*/
750750
if let result = _url.deletingLastPathComponent.map({ URL(reference: $0 as NSURL) }) {
751751
return result
@@ -762,12 +762,12 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable {
762762
public func appendingPathExtension(_ pathExtension: String) throws -> URL {
763763
/*
764764
URLByAppendingPathExtension can return nil if:
765-
the new path extension is not a valid extension (see _CFExtensionIsValidToAppend)
766-
the URL is a file reference URL which cannot be resolved back to a path.
767-
the URL does not have a path component. (see note 1)
768-
a mutable copy of the URLs string could not be created.
769-
a percent-encoded string of the new path extension could not created using the same encoding as the URLs string. (see note 1))
770-
a new URL object could not be created with the modified URL string.
765+
* the new path extension is not a valid extension (see _CFExtensionIsValidToAppend)
766+
* the URL is a file reference URL which cannot be resolved back to a path.
767+
* the URL does not have a path component. (see note 1)
768+
* a mutable copy of the URLs string could not be created.
769+
* a percent-encoded string of the new path extension could not created using the same encoding as the URL's string. (see note 1))
770+
* a new URL object could not be created with the modified URL string.
771771
*/
772772
guard let result = _url.appendingPathExtension(pathExtension) else {
773773
throw NSError(domain: NSCocoaErrorDomain, code: NSFileReadUnknownError, userInfo: [:])
@@ -781,10 +781,10 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable {
781781
public func deletingPathExtension() throws -> URL {
782782
/*
783783
URLByDeletingPathExtension can return nil if:
784-
the URL is a file reference URL which cannot be resolved back to a path.
785-
the URL does not have a path component. (see note 1)
786-
a mutable copy of the URLs string could not be created.
787-
a new URL object could not be created with the modified URL string.
784+
* the URL is a file reference URL which cannot be resolved back to a path.
785+
* the URL does not have a path component. (see note 1)
786+
* a mutable copy of the URLs string could not be created.
787+
* a new URL object could not be created with the modified URL string.
788788
*/
789789
if let result = _url.deletingPathExtension.map({ URL(reference: $0 as NSURL) }) {
790790
return result
@@ -801,8 +801,8 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable {
801801
public func standardizingPath() throws -> URL {
802802
/*
803803
URLByStandardizingPath can return nil if:
804-
the URL is a file reference URL which cannot be resolved back to a path.
805-
a new URL object could not be created with the standardized path).
804+
* the URL is a file reference URL which cannot be resolved back to a path.
805+
* a new URL object could not be created with the standardized path).
806806
*/
807807
if let result = _url.standardizingPath.map({ URL(reference: $0 as NSURL) }) {
808808
return result
@@ -819,9 +819,9 @@ public struct URL : ReferenceConvertible, CustomStringConvertible, Equatable {
819819
public func resolvingSymlinksInPath() throws -> URL {
820820
/*
821821
URLByResolvingSymlinksInPath can return nil if:
822-
the URL is a file reference URL which cannot be resolved back to a path.
823-
NSPathUtilities stringByResolvingSymlinksInPath property returns nil.
824-
a new URL object could not be created with the resolved path).
822+
* the URL is a file reference URL which cannot be resolved back to a path.
823+
* NSPathUtilities' stringByResolvingSymlinksInPath property returns nil.
824+
* a new URL object could not be created with the resolved path).
825825
*/
826826
if let result = _url.resolvingSymlinksInPath.map({ URL(reference: $0 as NSURL) }) {
827827
return result

stdlib/public/SDK/Foundation/URLComponents.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public struct URLComponents : ReferenceConvertible, Hashable, CustomStringConver
266266
///
267267
/// Each `URLQueryItem` represents a single key-value pair,
268268
///
269-
/// Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the `URLComponents` has an empty query component, returns an empty array. If the `URLComponents` has no query component, returns nil.
269+
/// Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the `URLComponents` has an empty query component, returns an empty array. If the `URLComponents` has no query component, returns nil.
270270
///
271271
/// The setter combines an array containing any number of `URLQueryItem`s, each of which represents a single key-value pair, into a query string and sets the `URLComponents` query property. Passing an empty array sets the query component of the `URLComponents` to an empty string. Passing nil removes the query component of the `URLComponents`.
272272
///

0 commit comments

Comments
 (0)