diff --git a/.swiftlint.yml b/.swiftlint.yml index f8f3d47..4b25ea0 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -104,6 +104,14 @@ closure_body_length: conditional_returns_on_newline: if_only: true +file_header: + required_pattern: | + \/\/ + \/\/ Stencil + \/\/ Copyright © 2022 Stencil + \/\/ MIT Licence + \/\/ + indentation_width: indentation_width: 2 diff --git a/LICENSE b/LICENSE index 8aa8286..b3382e3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018, Kyle Fuller +Copyright (c) 2022, Kyle Fuller All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/Sources/Stencil/Context.swift b/Sources/Stencil/Context.swift index b4a0b2a..07136f5 100644 --- a/Sources/Stencil/Context.swift +++ b/Sources/Stencil/Context.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + /// A container for template variables. public class Context { var dictionaries: [[String: Any?]] diff --git a/Sources/Stencil/DynamicMemberLookup.swift b/Sources/Stencil/DynamicMemberLookup.swift index be1eec8..1ae7184 100644 --- a/Sources/Stencil/DynamicMemberLookup.swift +++ b/Sources/Stencil/DynamicMemberLookup.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + /// Marker protocol so we can know which types support `@dynamicMemberLookup`. Add this to your own types that support /// lookup by String. public protocol DynamicMemberLookup { diff --git a/Sources/Stencil/Environment.swift b/Sources/Stencil/Environment.swift index e758de3..ba0f506 100644 --- a/Sources/Stencil/Environment.swift +++ b/Sources/Stencil/Environment.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + /// Container for environment data, such as registered extensions public struct Environment { /// The class for loading new templates diff --git a/Sources/Stencil/Errors.swift b/Sources/Stencil/Errors.swift index 423fe87..5379296 100644 --- a/Sources/Stencil/Errors.swift +++ b/Sources/Stencil/Errors.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + public class TemplateDoesNotExist: Error, CustomStringConvertible { let templateNames: [String] let loader: Loader? diff --git a/Sources/Stencil/Expression.swift b/Sources/Stencil/Expression.swift index 1e8ab18..826c5c9 100644 --- a/Sources/Stencil/Expression.swift +++ b/Sources/Stencil/Expression.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + public protocol Expression: CustomStringConvertible, Resolvable { func evaluate(context: Context) throws -> Bool } diff --git a/Sources/Stencil/Extension.swift b/Sources/Stencil/Extension.swift index 42d5431..1058607 100644 --- a/Sources/Stencil/Extension.swift +++ b/Sources/Stencil/Extension.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + /// Container for registered tags and filters open class Extension { typealias TagParser = (TokenParser, Token) throws -> NodeType diff --git a/Sources/Stencil/FilterTag.swift b/Sources/Stencil/FilterTag.swift index e623b53..e424963 100644 --- a/Sources/Stencil/FilterTag.swift +++ b/Sources/Stencil/FilterTag.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + class FilterNode: NodeType { let resolvable: Resolvable let nodes: [NodeType] diff --git a/Sources/Stencil/Filters.swift b/Sources/Stencil/Filters.swift index 2a719e4..c7a398e 100644 --- a/Sources/Stencil/Filters.swift +++ b/Sources/Stencil/Filters.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + func capitalise(_ value: Any?) -> Any? { if let array = value as? [Any?] { return array.map { stringify($0).capitalized } diff --git a/Sources/Stencil/ForTag.swift b/Sources/Stencil/ForTag.swift index ac3e298..b7dea3c 100644 --- a/Sources/Stencil/ForTag.swift +++ b/Sources/Stencil/ForTag.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation class ForNode: NodeType { diff --git a/Sources/Stencil/IfTag.swift b/Sources/Stencil/IfTag.swift index bde3354..56147f0 100644 --- a/Sources/Stencil/IfTag.swift +++ b/Sources/Stencil/IfTag.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + enum Operator { case infix(String, Int, InfixOperator.Type) case prefix(String, Int, PrefixOperator.Type) diff --git a/Sources/Stencil/Include.swift b/Sources/Stencil/Include.swift index 48f422c..65f2dc4 100644 --- a/Sources/Stencil/Include.swift +++ b/Sources/Stencil/Include.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit class IncludeNode: NodeType { diff --git a/Sources/Stencil/Inheritance.swift b/Sources/Stencil/Inheritance.swift index 971ded1..2b282c9 100644 --- a/Sources/Stencil/Inheritance.swift +++ b/Sources/Stencil/Inheritance.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + class BlockContext { class var contextKey: String { "block_context" } diff --git a/Sources/Stencil/KeyPath.swift b/Sources/Stencil/KeyPath.swift index 98767b7..277eb20 100644 --- a/Sources/Stencil/KeyPath.swift +++ b/Sources/Stencil/KeyPath.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation /// A structure used to represent a template variable, and to resolve it in a given context. diff --git a/Sources/Stencil/Lexer.swift b/Sources/Stencil/Lexer.swift index a017f04..576ff2e 100644 --- a/Sources/Stencil/Lexer.swift +++ b/Sources/Stencil/Lexer.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation typealias Line = (content: String, number: UInt, range: Range) diff --git a/Sources/Stencil/Loader.swift b/Sources/Stencil/Loader.swift index 3e6b1dd..76e96c8 100644 --- a/Sources/Stencil/Loader.swift +++ b/Sources/Stencil/Loader.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation import PathKit diff --git a/Sources/Stencil/Node.swift b/Sources/Stencil/Node.swift index 7998e76..49c98d1 100644 --- a/Sources/Stencil/Node.swift +++ b/Sources/Stencil/Node.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation /// Represents a parsed node diff --git a/Sources/Stencil/NowTag.swift b/Sources/Stencil/NowTag.swift index bad6627..639549f 100644 --- a/Sources/Stencil/NowTag.swift +++ b/Sources/Stencil/NowTag.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + #if !os(Linux) import Foundation diff --git a/Sources/Stencil/Parser.swift b/Sources/Stencil/Parser.swift index f213ba1..3fe30ba 100644 --- a/Sources/Stencil/Parser.swift +++ b/Sources/Stencil/Parser.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + /// Creates a checker that will stop parsing if it encounters a list of tags. /// Useful for example for scanning until a given "end"-node. public func until(_ tags: [String]) -> ((TokenParser, Token) -> Bool) { diff --git a/Sources/Stencil/Template.swift b/Sources/Stencil/Template.swift index a75af24..8061962 100644 --- a/Sources/Stencil/Template.swift +++ b/Sources/Stencil/Template.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation import PathKit diff --git a/Sources/Stencil/Tokenizer.swift b/Sources/Stencil/Tokenizer.swift index af01a15..103c5b6 100644 --- a/Sources/Stencil/Tokenizer.swift +++ b/Sources/Stencil/Tokenizer.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation extension String { diff --git a/Sources/Stencil/TrimBehaviour.swift b/Sources/Stencil/TrimBehaviour.swift index 05643a2..c639593 100644 --- a/Sources/Stencil/TrimBehaviour.swift +++ b/Sources/Stencil/TrimBehaviour.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation public struct TrimBehaviour: Equatable { diff --git a/Sources/Stencil/Variable.swift b/Sources/Stencil/Variable.swift index 9d09134..5fe5c10 100644 --- a/Sources/Stencil/Variable.swift +++ b/Sources/Stencil/Variable.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Foundation typealias Number = Float diff --git a/Tests/StencilTests/ContextSpec.swift b/Tests/StencilTests/ContextSpec.swift index dd2a74a..926c0ec 100644 --- a/Tests/StencilTests/ContextSpec.swift +++ b/Tests/StencilTests/ContextSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/EnvironmentBaseAndChildTemplateSpec.swift b/Tests/StencilTests/EnvironmentBaseAndChildTemplateSpec.swift index c163239..036b986 100644 --- a/Tests/StencilTests/EnvironmentBaseAndChildTemplateSpec.swift +++ b/Tests/StencilTests/EnvironmentBaseAndChildTemplateSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre @testable import Stencil diff --git a/Tests/StencilTests/EnvironmentIncludeTemplateSpec.swift b/Tests/StencilTests/EnvironmentIncludeTemplateSpec.swift index 1ed975f..67ec956 100644 --- a/Tests/StencilTests/EnvironmentIncludeTemplateSpec.swift +++ b/Tests/StencilTests/EnvironmentIncludeTemplateSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre @testable import Stencil diff --git a/Tests/StencilTests/EnvironmentSpec.swift b/Tests/StencilTests/EnvironmentSpec.swift index ef2d0fb..70d7955 100644 --- a/Tests/StencilTests/EnvironmentSpec.swift +++ b/Tests/StencilTests/EnvironmentSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre @testable import Stencil diff --git a/Tests/StencilTests/ExpressionSpec.swift b/Tests/StencilTests/ExpressionSpec.swift index 03d50b9..d69f757 100644 --- a/Tests/StencilTests/ExpressionSpec.swift +++ b/Tests/StencilTests/ExpressionSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/FilterSpec.swift b/Tests/StencilTests/FilterSpec.swift index 092c943..1f88eef 100644 --- a/Tests/StencilTests/FilterSpec.swift +++ b/Tests/StencilTests/FilterSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/FilterTagSpec.swift b/Tests/StencilTests/FilterTagSpec.swift index d73cf40..18d0d69 100644 --- a/Tests/StencilTests/FilterTagSpec.swift +++ b/Tests/StencilTests/FilterTagSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre import Stencil import XCTest diff --git a/Tests/StencilTests/ForNodeSpec.swift b/Tests/StencilTests/ForNodeSpec.swift index 9d31b58..fb145d8 100644 --- a/Tests/StencilTests/ForNodeSpec.swift +++ b/Tests/StencilTests/ForNodeSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/Helpers.swift b/Tests/StencilTests/Helpers.swift index 8a82ee5..bba58c4 100644 --- a/Tests/StencilTests/Helpers.swift +++ b/Tests/StencilTests/Helpers.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre @testable import Stencil diff --git a/Tests/StencilTests/IfNodeSpec.swift b/Tests/StencilTests/IfNodeSpec.swift index 8107b9c..ec86be7 100644 --- a/Tests/StencilTests/IfNodeSpec.swift +++ b/Tests/StencilTests/IfNodeSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/IncludeSpec.swift b/Tests/StencilTests/IncludeSpec.swift index 10bb4c3..bb35954 100644 --- a/Tests/StencilTests/IncludeSpec.swift +++ b/Tests/StencilTests/IncludeSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre @testable import Stencil diff --git a/Tests/StencilTests/InheritanceSpec.swift b/Tests/StencilTests/InheritanceSpec.swift index 117b605..a586ffd 100644 --- a/Tests/StencilTests/InheritanceSpec.swift +++ b/Tests/StencilTests/InheritanceSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre import Stencil diff --git a/Tests/StencilTests/LexerSpec.swift b/Tests/StencilTests/LexerSpec.swift index 1c168f3..1ec364d 100644 --- a/Tests/StencilTests/LexerSpec.swift +++ b/Tests/StencilTests/LexerSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre @testable import Stencil diff --git a/Tests/StencilTests/LoaderSpec.swift b/Tests/StencilTests/LoaderSpec.swift index 983e5ba..c2030bb 100644 --- a/Tests/StencilTests/LoaderSpec.swift +++ b/Tests/StencilTests/LoaderSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import PathKit import Spectre import Stencil diff --git a/Tests/StencilTests/NodeSpec.swift b/Tests/StencilTests/NodeSpec.swift index c7659f6..ae356ca 100644 --- a/Tests/StencilTests/NodeSpec.swift +++ b/Tests/StencilTests/NodeSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/NowNodeSpec.swift b/Tests/StencilTests/NowNodeSpec.swift index a213a32..32743c7 100644 --- a/Tests/StencilTests/NowNodeSpec.swift +++ b/Tests/StencilTests/NowNodeSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/ParserSpec.swift b/Tests/StencilTests/ParserSpec.swift index 44d79d9..fb591b5 100644 --- a/Tests/StencilTests/ParserSpec.swift +++ b/Tests/StencilTests/ParserSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/StencilSpec.swift b/Tests/StencilTests/StencilSpec.swift index 8e01b63..daac7c3 100644 --- a/Tests/StencilTests/StencilSpec.swift +++ b/Tests/StencilTests/StencilSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre import Stencil import XCTest diff --git a/Tests/StencilTests/TemplateSpec.swift b/Tests/StencilTests/TemplateSpec.swift index 433f1cb..aea8a01 100644 --- a/Tests/StencilTests/TemplateSpec.swift +++ b/Tests/StencilTests/TemplateSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/TokenSpec.swift b/Tests/StencilTests/TokenSpec.swift index effa884..fa3d293 100644 --- a/Tests/StencilTests/TokenSpec.swift +++ b/Tests/StencilTests/TokenSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/Tests/StencilTests/TrimBehaviourSpec.swift b/Tests/StencilTests/TrimBehaviourSpec.swift index 6c67492..4bc879b 100644 --- a/Tests/StencilTests/TrimBehaviourSpec.swift +++ b/Tests/StencilTests/TrimBehaviourSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre import Stencil import XCTest diff --git a/Tests/StencilTests/VariableSpec.swift b/Tests/StencilTests/VariableSpec.swift index 8155775..4ed538e 100644 --- a/Tests/StencilTests/VariableSpec.swift +++ b/Tests/StencilTests/VariableSpec.swift @@ -1,3 +1,9 @@ +// +// Stencil +// Copyright © 2022 Stencil +// MIT Licence +// + import Spectre @testable import Stencil import XCTest diff --git a/docs/conf.py b/docs/conf.py index 44ce5df..eb1c923 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -50,7 +50,7 @@ master_doc = 'index' # General information about the project. project = 'Stencil' -copyright = '2016, Kyle Fuller' +copyright = '2022, Kyle Fuller' author = 'Kyle Fuller' # The version info for the project you're documenting, acts as replacement for