Skip to content

Commit ad8be77

Browse files
committed
Swiftlint fixes
1 parent a4628e0 commit ad8be77

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Examples/AttributedStringExample/Sources/AttributedStringExample/TemplateExample.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ public class AttributedStringTemplateInterpreter: TemplateInterpreter<NSAttribut
99

1010
override public func evaluate(_ expression: String, context: Context = Context()) -> NSAttributedString {
1111
return evaluate(expression, context: context, reducer: (initialValue: NSAttributedString(), reduceValue: { existing, next in
12-
return existing.appending(next)
12+
existing.appending(next)
1313
}, reduceCharacter: { existing, next in
14-
return existing.appending(NSAttributedString(string: String(next)))
14+
existing.appending(NSAttributedString(string: String(next)))
1515
}))
1616
}
1717
}

Examples/TemplateExample/Sources/TemplateExample/TemplateExample.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ public class StandardLibrary {
428428

429429
public static var arrayType: DataType<[CustomStringConvertible]> {
430430
let arrayLiteral = literal(opening: "[", closing: "]") { input, interpreter -> [CustomStringConvertible]? in
431-
return input
431+
input
432432
.split(separator: ",")
433433
.map { $0.trimmingCharacters(in: .whitespacesAndNewlines) }
434434
.map { interpreter.evaluate(String($0)) as? CustomStringConvertible ?? String($0) }
@@ -929,13 +929,13 @@ public class StandardLibrary {
929929

930930
public static var loopIsFirst: Function<Bool?> {
931931
return Function([Variable<Any>("value"), Keyword("is first")]) { _, _, context in
932-
return context.variables["__first"] as? Bool
932+
context.variables["__first"] as? Bool
933933
}
934934
}
935935

936936
public static var loopIsLast: Function<Bool?> {
937937
return Function([Variable<Any>("value"), Keyword("is last")]) { _, _, context in
938-
return context.variables["__last"] as? Bool
938+
context.variables["__last"] as? Bool
939939
}
940940
}
941941

@@ -977,7 +977,7 @@ public class StandardLibrary {
977977

978978
public static var dictionaryKeys: Function<[String]> {
979979
return objectFunction("keys") { (object: [String: Any?]) -> [String] in
980-
return object.keys.sorted()
980+
object.keys.sorted()
981981
}
982982
}
983983

Sources/Eval/Utilities/Pattern.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public class Pattern<T, I: Interpreter> {
104104
let processor = VariableProcessor(interpreter: interpreter, context: context)
105105
let matcher = Matcher(elements: elements, processor: processor, options: options)
106106
let result = matcher.match(string: string, from: start) { variables in
107-
return self.matcher(variables, interpreter, context)
107+
self.matcher(variables, interpreter, context)
108108
}
109109

110110
if case let .exactMatch(_, output, variables) = result {

Tests/EvalTests/IntegrationTests/TemplateTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class TemplateTests: XCTestCase {
3939
let interpreter = TypedInterpreter(dataTypes: [numberDataType(), stringDataType(), booleanDataType()], functions: [parenthesis, lessThan], context: Context())
4040

4141
let braces = Pattern<String, TemplateInterpreter<String>>([OpenKeyword("("), TemplateVariable("body"), CloseKeyword(")")]) { variables, _, _ -> String? in
42-
return variables["body"] as? String
42+
variables["body"] as? String
4343
}
4444
let ifStatement = Pattern<String, TemplateInterpreter<String>>([OpenKeyword("{% if"), Variable<Bool>("condition"), Keyword("%}"), TemplateVariable("body"), CloseKeyword("{% endif %}")]) { variables, _, _ -> String? in
4545
guard let condition = variables["condition"] as? Bool, let body = variables["body"] as? String else { return nil }

0 commit comments

Comments
 (0)