Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .circleci/config.pkl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ amends "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.circleci@1.0.1#/
prb {
jobs {
"test"
"test-license-headers"
}
}

main {
jobs {
"test"
"test-license-headers"
}
}

Expand All @@ -32,4 +34,18 @@ jobs {
}
}
}

["test-license-headers"] {
docker {
new {
image = "ghcr.io/korandoru/hawkeye"
}
}
steps {
"checkout"
new RunStep {
command = "/bin/hawkeye check --fail-if-unknown"
}
}
}
}
12 changes: 12 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ jobs:
PKL_EXEC=$(pwd)/pkl.bin swift test
docker:
- image: swift:5.9
test-license-headers:
steps:
- checkout
- run:
command: /bin/hawkeye check --fail-if-unknown
docker:
- image: ghcr.io/korandoru/hawkeye
workflows:
prb:
jobs:
Expand All @@ -26,13 +33,18 @@ workflows:
requires:
- hold
- pr-approval/authenticate
- test-license-headers:
requires:
- hold
- pr-approval/authenticate
when:
matches:
value: << pipeline.git.branch >>
pattern: ^pull/\d+(/head)?$
main:
jobs:
- test
- test-license-headers
when:
equal:
- main
Expand Down
16 changes: 16 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
// swift-tools-version:5.9
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//===----------------------------------------------------------------------===//

import PackageDescription

let package = Package(
Expand Down
8 changes: 4 additions & 4 deletions Sources/App/configure.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

import Gen
import PklSwift
Expand Down
8 changes: 4 additions & 4 deletions Sources/App/entrypoint.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

import Logging
import Vapor
Expand Down
8 changes: 4 additions & 4 deletions Sources/App/routes.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

import Vapor

Expand Down
8 changes: 4 additions & 4 deletions Sources/Gen/Config.pkl.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

// Code generated from Pkl module `Config`. DO NOT EDIT.
import PklSwift
Expand Down
8 changes: 4 additions & 4 deletions Tests/AppTests/AppTests.swift
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

@testable import App
import XCTVapor
Expand Down
30 changes: 30 additions & 0 deletions licenserc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
additionalHeaders = ["scripts/swift-header-style.toml"]

headerPath = "scripts/license-header.txt"

includes = [
"*.swift",
"*.pkl",
"*.h",
"*.cpp",
"*.sh",
"PklProject",
]

excludes = [
"Sources/pkl-gen-swift/Generated",
"Tests/PklSwiftTests/Fixtures",
"codegen/snippet-tests",
"doc",
]

[git]
attrs = 'enable'
ignore = 'enable'

[properties]
copyrightOwner = "Apple Inc. and the Pkl project authors"

[mapping.SWIFT_STYLE]
extensions = ["swift"]

9 changes: 5 additions & 4 deletions pkl/Config.pkl
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

module Config

/// The address the server will accept connections on
Expand Down
9 changes: 5 additions & 4 deletions pkl/dev/config.pkl
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
// ===----------------------------------------------------------------------===//
// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved.
//===----------------------------------------------------------------------===//
// Copyright © 2024-2025 Apple Inc. and the Pkl project authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//

amends "../Config.pkl"

hostname = "localhost"
Expand Down
13 changes: 13 additions & 0 deletions scripts/license-header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright ©{{ " " }}{%- if attrs.git_file_modified_year != attrs.git_file_created_year -%}{{ attrs.git_file_created_year }}-{{ attrs.git_file_modified_year }}{%- else -%}{{ attrs.git_file_created_year }}{%- endif -%}{{ " " }}{{ props["copyrightOwner"] }}. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
11 changes: 11 additions & 0 deletions scripts/swift-header-style.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[SWIFT_STYLE]
firstLine = '//===----------------------------------------------------------------------===//'
endLine = "//===----------------------------------------------------------------------===//\n"
beforeEachLine = '// '
afterEachLine = ''
allowBlankLines = false
multipleLines = true
padLines = false
firstLineDetectionPattern = '//\s?==='
lastLineDetectionPattern = '//\s?==='
skipLinePattern = '// swift-tools-version'