forked from realm/SwiftLint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also removes `missing_docs` and `valid_docs` rules. Fixes realm#1453.
- Loading branch information
1 parent
80b0c96
commit d73ee8d
Showing
26 changed files
with
125 additions
and
910 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
Source/SwiftLintFramework/Extensions/AccessControlLevel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// AccessControlLevel.swift | ||
// SwiftLint | ||
// | ||
// Created by Marcelo Fabri on 23/04/17. | ||
// Copyright © 2017 Realm. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
public enum AccessControlLevel: String, CustomStringConvertible { | ||
case `private` = "source.lang.swift.accessibility.private" | ||
case `fileprivate` = "source.lang.swift.accessibility.fileprivate" | ||
case `internal` = "source.lang.swift.accessibility.internal" | ||
case `public` = "source.lang.swift.accessibility.public" | ||
case `open` = "source.lang.swift.accessibility.open" | ||
|
||
internal init?(description value: String) { | ||
switch value { | ||
case "private": self = .private | ||
case "fileprivate": self = .fileprivate | ||
case "internal": self = .internal | ||
case "public": self = .public | ||
case "open": self = .open | ||
default: return nil | ||
} | ||
} | ||
|
||
init?(identifier value: String) { | ||
self.init(rawValue: value) | ||
} | ||
|
||
public var description: String { | ||
switch self { | ||
case .private: return "private" | ||
case .fileprivate: return "fileprivate" | ||
case .internal: return "internal" | ||
case .public: return "public" | ||
case .open: return "open" | ||
} | ||
} | ||
|
||
// Returns true if is `private` or `fileprivate` | ||
var isPrivate: Bool { | ||
return self == .private || self == .fileprivate | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.