diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1f09c56..9672f57 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @adam-fowler @Joannis +* @astzweig/coders diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 7fc910b..0000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -github: adam-fowler diff --git a/README.md b/README.md index e98b005..d9f8dd5 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,19 @@ Package for rendering Mustache templates. Mustache is a "logic-less" templating language commonly used in web and mobile platforms. You can find out more about Mustache [here](http://mustache.github.io/mustache.5.html). +> [!NOTE] +> This repository is a fork of [hummingbird-project/swift-mustache](https://github.com/hummingbird-project/swift-mustache). It may contain modifications required by our other open source tools. + ## Usage -Load your templates from the filesystem +Load your templates from the filesystem ```swift import Mustache let library = MustacheLibrary("folder/my/templates/are/in") ``` This will look for all the files with the extension ".mustache" in the specified folder and subfolders and attempt to load them. Each file is registed with the name of the file (with subfolder, if inside a subfolder) minus the "mustache" extension. -Render an object with a template +Render an object with a template ```swift let output = library.render(object, withTemplate: "myTemplate") ``` @@ -19,7 +22,7 @@ let output = library.render(object, withTemplate: "myTemplate") ## Support -Swift-Mustache supports all standard Mustache tags and is fully compliant with the Mustache [spec](https://github.com/mustache/spec) with the exception of the Lambda support. +Swift-Mustache supports all standard Mustache tags and is fully compliant with the Mustache [spec](https://github.com/mustache/spec) with the exception of the Lambda support. ## Additional features diff --git a/Sources/Mustache/ContentType.swift b/Sources/Mustache/ContentType.swift index 615e920..f31a3ec 100644 --- a/Sources/Mustache/ContentType.swift +++ b/Sources/Mustache/ContentType.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Foundation /// Protocol for content types diff --git a/Sources/Mustache/Context.swift b/Sources/Mustache/Context.swift index 0783f0c..b617628 100644 --- a/Sources/Mustache/Context.swift +++ b/Sources/Mustache/Context.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - /// Context while rendering mustache tokens struct MustacheContext { let stack: [Any] diff --git a/Sources/Mustache/CustomRenderable.swift b/Sources/Mustache/CustomRenderable.swift index 003f399..ced1c0f 100644 --- a/Sources/Mustache/CustomRenderable.swift +++ b/Sources/Mustache/CustomRenderable.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Foundation /// Allow object to override standard hummingbird type rendering which uses diff --git a/Sources/Mustache/Deprecations.swift b/Sources/Mustache/Deprecations.swift index 1f00214..227941b 100644 --- a/Sources/Mustache/Deprecations.swift +++ b/Sources/Mustache/Deprecations.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - // Below is a list of unavailable symbols with the "HB" prefix. These are available // temporarily to ease transition from the old symbols that included the "HB" // prefix to the new ones. diff --git a/Sources/Mustache/Lambda.swift b/Sources/Mustache/Lambda.swift index c236ed0..0a095df 100644 --- a/Sources/Mustache/Lambda.swift +++ b/Sources/Mustache/Lambda.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - /// Lambda function. Can add this to object being rendered to filter contents of objects. /// /// See http://mustache.github.io/mustache.5.html for more details on diff --git a/Sources/Mustache/Library+FileSystem.swift b/Sources/Mustache/Library+FileSystem.swift index 1396e25..bf49171 100644 --- a/Sources/Mustache/Library+FileSystem.swift +++ b/Sources/Mustache/Library+FileSystem.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Foundation extension MustacheLibrary { diff --git a/Sources/Mustache/Library.swift b/Sources/Mustache/Library.swift index 00ccefa..1ad48a8 100644 --- a/Sources/Mustache/Library.swift +++ b/Sources/Mustache/Library.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - /// Class holding a collection of mustache templates. /// /// Each template can reference the others via a partial using the name the template is registered under diff --git a/Sources/Mustache/Mirror.swift b/Sources/Mustache/Mirror.swift index 50811eb..6b032fc 100644 --- a/Sources/Mustache/Mirror.swift +++ b/Sources/Mustache/Mirror.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - extension Mirror { /// Return value from Mirror given name func getValue(forKey key: String) -> Any? { diff --git a/Sources/Mustache/NSLock+Backport.swift b/Sources/Mustache/NSLock+Backport.swift index d4650a0..e57a54b 100644 --- a/Sources/Mustache/NSLock+Backport.swift +++ b/Sources/Mustache/NSLock+Backport.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - #if compiler(<6.0) import Foundation diff --git a/Sources/Mustache/Parent.swift b/Sources/Mustache/Parent.swift index 3b396ec..ed44506 100644 --- a/Sources/Mustache/Parent.swift +++ b/Sources/Mustache/Parent.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - /// Protocol for object that has a custom method for accessing their children, instead /// of using Mirror public protocol MustacheParent { diff --git a/Sources/Mustache/Parser.swift b/Sources/Mustache/Parser.swift index 85b5d4a..2006897 100644 --- a/Sources/Mustache/Parser.swift +++ b/Sources/Mustache/Parser.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Foundation /// Reader object for parsing String buffers diff --git a/Sources/Mustache/Sequence.swift b/Sources/Mustache/Sequence.swift index cf0f830..ae242f0 100644 --- a/Sources/Mustache/Sequence.swift +++ b/Sources/Mustache/Sequence.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - /// Protocol for objects that can be rendered as a sequence in Mustache public protocol MustacheSequence: Sequence {} diff --git a/Sources/Mustache/SequenceContext.swift b/Sources/Mustache/SequenceContext.swift index a592554..56498be 100644 --- a/Sources/Mustache/SequenceContext.swift +++ b/Sources/Mustache/SequenceContext.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - /// Context that current object inside a sequence is being rendered in. Only relevant when rendering a sequence struct MustacheSequenceContext: MustacheTransformable { var first: Bool diff --git a/Sources/Mustache/String.swift b/Sources/Mustache/String.swift index b9d7037..888fe36 100644 --- a/Sources/Mustache/String.swift +++ b/Sources/Mustache/String.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - extension String { private static let htmlEscapedCharacters: [Character: String] = [ "<": "<", diff --git a/Sources/Mustache/Template+FileSystem.swift b/Sources/Mustache/Template+FileSystem.swift index 54a278a..6f082fa 100644 --- a/Sources/Mustache/Template+FileSystem.swift +++ b/Sources/Mustache/Template+FileSystem.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Foundation extension MustacheTemplate { diff --git a/Sources/Mustache/Template+Parser.swift b/Sources/Mustache/Template+Parser.swift index af992b2..2631805 100644 --- a/Sources/Mustache/Template+Parser.swift +++ b/Sources/Mustache/Template+Parser.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - extension MustacheTemplate { /// Error return by `MustacheTemplate.parse`. Includes information about where error occurred public struct ParserError: Swift.Error { diff --git a/Sources/Mustache/Template+Render.swift b/Sources/Mustache/Template+Render.swift index e0b476b..c417fa5 100644 --- a/Sources/Mustache/Template+Render.swift +++ b/Sources/Mustache/Template+Render.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Foundation extension MustacheTemplate { diff --git a/Sources/Mustache/Template.swift b/Sources/Mustache/Template.swift index 5a72e54..e8fc01b 100644 --- a/Sources/Mustache/Template.swift +++ b/Sources/Mustache/Template.swift @@ -1,18 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - -/// Class holding Mustache template public struct MustacheTemplate: Sendable, CustomStringConvertible { /// Initialize template /// - Parameter string: Template text diff --git a/Sources/Mustache/Transform.swift b/Sources/Mustache/Transform.swift index 4e5ea1e..d3bc8f9 100644 --- a/Sources/Mustache/Transform.swift +++ b/Sources/Mustache/Transform.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - /// Objects that can have a transforms run on them. Mustache transforms are specific to this implementation /// of Mustache. They allow you to process objects before they are rendered. /// diff --git a/Tests/MustacheTests/ErrorTests.swift b/Tests/MustacheTests/ErrorTests.swift index a9bb51c..950e6d1 100644 --- a/Tests/MustacheTests/ErrorTests.swift +++ b/Tests/MustacheTests/ErrorTests.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Mustache import XCTest diff --git a/Tests/MustacheTests/LibraryTests.swift b/Tests/MustacheTests/LibraryTests.swift index 6ccf2fb..33405d4 100644 --- a/Tests/MustacheTests/LibraryTests.swift +++ b/Tests/MustacheTests/LibraryTests.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2024 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import XCTest @testable import Mustache diff --git a/Tests/MustacheTests/PartialTests.swift b/Tests/MustacheTests/PartialTests.swift index 5b82c96..4921a78 100644 --- a/Tests/MustacheTests/PartialTests.swift +++ b/Tests/MustacheTests/PartialTests.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import XCTest @testable import Mustache diff --git a/Tests/MustacheTests/SpecTests.swift b/Tests/MustacheTests/SpecTests.swift index d93a580..cc0ad27 100644 --- a/Tests/MustacheTests/SpecTests.swift +++ b/Tests/MustacheTests/SpecTests.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Foundation import Mustache import XCTest diff --git a/Tests/MustacheTests/TemplateParserTests.swift b/Tests/MustacheTests/TemplateParserTests.swift index 5baf2c0..9f730ea 100644 --- a/Tests/MustacheTests/TemplateParserTests.swift +++ b/Tests/MustacheTests/TemplateParserTests.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import XCTest @testable import Mustache diff --git a/Tests/MustacheTests/TemplateRendererTests.swift b/Tests/MustacheTests/TemplateRendererTests.swift index 14c3436..dec5e9a 100644 --- a/Tests/MustacheTests/TemplateRendererTests.swift +++ b/Tests/MustacheTests/TemplateRendererTests.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Mustache import XCTest diff --git a/Tests/MustacheTests/TransformTests.swift b/Tests/MustacheTests/TransformTests.swift index 6c990ea..80d9785 100644 --- a/Tests/MustacheTests/TransformTests.swift +++ b/Tests/MustacheTests/TransformTests.swift @@ -1,17 +1,3 @@ -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) 2021-2021 the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// - import Mustache import XCTest diff --git a/scripts/validate.sh b/scripts/validate.sh index f949949..861537f 100755 --- a/scripts/validate.sh +++ b/scripts/validate.sh @@ -1,31 +1,4 @@ #!/bin/bash -##===----------------------------------------------------------------------===## -## -## This source file is part of the Hummingbird server framework project -## -## Copyright (c) 2021-2024 the Hummingbird authors -## Licensed under Apache License v2.0 -## -## See LICENSE.txt for license information -## See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -## -## SPDX-License-Identifier: Apache-2.0 -## -##===----------------------------------------------------------------------===## -##===----------------------------------------------------------------------===## -## -## This source file is part of the SwiftNIO open source project -## -## Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors -## Licensed under Apache License v2.0 -## -## See LICENSE.txt for license information -## See CONTRIBUTORS.txt for the list of SwiftNIO project authors -## -## SPDX-License-Identifier: Apache-2.0 -## -##===----------------------------------------------------------------------===## - SWIFT_FORMAT_VERSION=0.53.10 set -eu @@ -49,78 +22,3 @@ if [[ "$FIRST_OUT" != "$SECOND_OUT" ]]; then else printf "\033[0;32mokay.\033[0m\n" fi -printf "=> Checking license headers... " -tmp=$(mktemp /tmp/.soto-core-sanity_XXXXXX) - -exit 0 - -for language in swift-or-c; do - declare -a matching_files - declare -a exceptions - expections=( ) - matching_files=( -name '*' ) - case "$language" in - swift-or-c) - exceptions=( -path '*/Benchmarks/.build/*' -o -name Package.swift) - matching_files=( -name '*.swift' -o -name '*.c' -o -name '*.h' ) - cat > "$tmp" <<"EOF" -//===----------------------------------------------------------------------===// -// -// This source file is part of the Hummingbird server framework project -// -// Copyright (c) YEARS the Hummingbird authors -// Licensed under Apache License v2.0 -// -// See LICENSE.txt for license information -// See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -// -// SPDX-License-Identifier: Apache-2.0 -// -//===----------------------------------------------------------------------===// -EOF - ;; - bash) - matching_files=( -name '*.sh' ) - cat > "$tmp" <<"EOF" -##===----------------------------------------------------------------------===## -## -## This source file is part of the Hummingbird server framework project -## -## Copyright (c) YEARS the Hummingbird authors -## Licensed under Apache License v2.0 -## -## See LICENSE.txt for license information -## See hummingbird/CONTRIBUTORS.txt for the list of Hummingbird authors -## -## SPDX-License-Identifier: Apache-2.0 -## -##===----------------------------------------------------------------------===## -EOF - ;; - *) - echo >&2 "ERROR: unknown language '$language'" - ;; - esac - - lines_to_compare=$(cat "$tmp" | wc -l | tr -d " ") - # need to read one more line as we remove the '#!' line - lines_to_read=$(expr "$lines_to_compare" + 1) - expected_sha=$(cat "$tmp" | shasum) - - ( - cd "$here/.." - find . \ - \( \! -path './.build/*' -a \ - \( "${matching_files[@]}" \) -a \ - \( \! \( "${exceptions[@]}" \) \) \) | while read line; do - if [[ "$(cat "$line" | head -n $lines_to_read | replace_acceptable_years | head -n $lines_to_compare | shasum)" != "$expected_sha" ]]; then - printf "\033[0;31mmissing headers in file '$line'!\033[0m\n" - diff -u <(cat "$line" | head -n $lines_to_read | replace_acceptable_years | head -n $lines_to_compare) "$tmp" - exit 1 - fi - done - printf "\033[0;32mokay.\033[0m\n" - ) -done - -rm "$tmp"