Reduce accessibility of members that should be private (#247)

This commit is contained in:
JP Simard 2020-04-16 16:56:22 -07:00 committed by GitHub
parent d53badf0fb
commit 9e1f96b6f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 13 deletions

View File

@ -14,7 +14,7 @@ public final class Resolver {
public struct Rule {
/// The tag name this rule applies to.
public let tag: Tag.Name
internal let regexp: NSRegularExpression
fileprivate let regexp: NSRegularExpression
/// The regex pattern used to resolve this rule.
public var pattern: String { return regexp.pattern }

View File

@ -53,7 +53,7 @@ public final class Tag {
let constructor: Constructor
var name: Name
func resolved<T>(with value: T) -> Tag where T: TagResolvable {
fileprivate func resolved<T>(with value: T) -> Tag where T: TagResolvable {
if name == .implicit {
name = resolver.resolveTag(of: value)
} else if name == .nonSpecific {

View File

@ -392,7 +392,7 @@ public func expectUnreachable(
XCTFail("this code should not be executed: \(message())", file: file, line: line)
}
func expectEqualPaths(
private func expectEqualPaths(
_ lhs: [CodingKey],
_ rhs: [CodingKey],
_ prefix: String,
@ -669,7 +669,7 @@ private enum EnhancedBool: Codable {
}
/// A type which encodes as an array directly through a single value container.
struct Numbers: Codable, Equatable {
private struct Numbers: Codable, Equatable {
let values = [4, 8, 15, 16, 23, 42]
init() {}
@ -724,7 +724,7 @@ private final class Mapping: Codable, Equatable {
}
}
struct NestedContainersTestType: Codable, Equatable {
private struct NestedContainersTestType: Codable, Equatable {
let testSuperCoder: Bool
static func == (lhs: NestedContainersTestType, rhs: NestedContainersTestType) -> Bool {
@ -735,14 +735,14 @@ struct NestedContainersTestType: Codable, Equatable {
self.testSuperCoder = testSuperCoder
}
enum TopLevelCodingKeys: Int, CodingKey {
private enum TopLevelCodingKeys: Int, CodingKey {
case testSuperCoder
case a
case b
case c
}
enum IntermediateCodingKeys: Int, CodingKey {
private enum IntermediateCodingKeys: Int, CodingKey {
case one
case two
}
@ -960,7 +960,7 @@ private struct OptionalTopLevelWrapper<T>: Codable, Equatable where T: Codable,
}
/// Coder supported types in KeyedContainer
struct KeyedSynthesized: Codable, Equatable {
private struct KeyedSynthesized: Codable, Equatable {
static func == (lhs: KeyedSynthesized, rhs: KeyedSynthesized) -> Bool {
return lhs.bool == rhs.bool &&
lhs.int == rhs.int && lhs.int8 == rhs.int8 && lhs.int16 == rhs.int16 &&
@ -991,7 +991,7 @@ struct KeyedSynthesized: Codable, Equatable {
}
/// Coder supported types in UnkeyedContainer
struct Unkeyed: Codable, Equatable {
private struct Unkeyed: Codable, Equatable {
static func == (lhs: Unkeyed, rhs: Unkeyed) -> Bool {
return lhs.bool == rhs.bool &&
lhs.int == rhs.int && lhs.int8 == rhs.int8 && lhs.int16 == rhs.int16 &&

View File

@ -10,7 +10,7 @@ import Foundation
import XCTest
import Yams
let fixturesDirectory = URL(fileURLWithPath: #file).deletingLastPathComponent().path + "/Fixtures/"
private let fixturesDirectory = URL(fileURLWithPath: #file).deletingLastPathComponent().path + "/Fixtures/"
class PerformanceTests: XCTestCase {
let filename = fixturesDirectory + "SourceKitten#289/debug.yaml"
@ -189,11 +189,11 @@ extension PerformanceTests {
}
// Models for parsing Build File of llbuild
struct Manifest: Decodable {
private struct Manifest: Decodable {
let commands: [String: Command]
}
struct Command: Decodable {
private struct Command: Decodable {
let moduleName: String?
let importPaths: [String]?
let otherArguments: [String]?

View File

@ -9,7 +9,7 @@
import Foundation
import XCTest
let gregorianCalendar = Calendar(identifier: .gregorian)
private let gregorianCalendar = Calendar(identifier: .gregorian)
func timestamp(_ timeZoneHour: Int = 0,
_ year: Int? = nil,