Add SwiftLint (#49)

This change adds SwiftLint to the project. For now, the rules are tweaked
to match the current state of the code base — but will over time be changed
back to their defaults in several cases.

Some smaller changes (mostly related to code style) were applied to the
project to remove all warnings.
This commit is contained in:
John Sundell 2019-03-11 14:52:46 +01:00 committed by GitHub
parent 892d6ae39c
commit 8bc46cbeb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 81 additions and 72 deletions

7
.swiftlint.yml Normal file
View File

@ -0,0 +1,7 @@
disabled_rules:
- nesting
line_length: 200
function_body_length: 100
type_body_length: 600
file_length: 800
cyclomatic_complexity: 15

View File

@ -21,7 +21,10 @@ public struct Theme {
/// What color to use for the text's highlighted tokens
public var tokenColors: [TokenType: Color]
public init(font: Font, plainTextColor: Color, tokenColors: [TokenType : Color], backgroundColor: Color = Color(white: 0.12, alpha: 1)) {
public init(font: Font,
plainTextColor: Color,
tokenColors: [TokenType: Color],
backgroundColor: Color = Color(white: 0.12, alpha: 1)) {
self.font = font
self.plainTextColor = plainTextColor
self.tokenColors = tokenColors

View File

@ -29,4 +29,3 @@ extension TokenTypeTests {
]
}
}