Project template updates (#25)
* Project template updates * More changes * run swiftformat
This commit is contained in:
21
.github/dependabot.yml
vendored
Normal file
21
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
groups:
|
||||
dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
- package-ecosystem: "swift"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
open-pull-requests-limit: 6
|
||||
allow:
|
||||
- dependency-type: all
|
||||
groups:
|
||||
all-dependencies:
|
||||
patterns:
|
||||
- "*"
|
||||
7
.github/workflows/api-breakage.yml
vendored
7
.github/workflows/api-breakage.yml
vendored
@@ -3,17 +3,16 @@ name: API breaking changes
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
container:
|
||||
image: swift:5.8
|
||||
image: swift:5.9
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# https://github.com/actions/checkout/issues/766
|
||||
|
||||
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
@@ -8,48 +8,21 @@ on:
|
||||
- '**.swift'
|
||||
- '**.yml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 2.x.x
|
||||
paths:
|
||||
- '**.swift'
|
||||
- '**.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
macOS:
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: SPM tests
|
||||
run: swift test --enable-code-coverage
|
||||
- name: Convert coverage files
|
||||
run: |
|
||||
xcrun llvm-cov export -format "lcov" \
|
||||
.build/debug/hummingbird-mustachePackageTests.xctest/Contents/MacOs/hummingbird-mustachePackageTests \
|
||||
-ignore-filename-regex="\/Tests\/" \
|
||||
-ignore-filename-regex="\/Benchmarks\/" \
|
||||
-instr-profile=.build/debug/codecov/default.profdata > info.lcov
|
||||
- name: Upload to codecov.io
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
file: info.lcov
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
matrix:
|
||||
image:
|
||||
- 'swift:5.7'
|
||||
- 'swift:5.8'
|
||||
- 'swift:5.9'
|
||||
- 'swiftlang/swift:nightly-5.10-jammy'
|
||||
image: ["swift:5.9", "swift:5.10", "swiftlang/swift:nightly-jammy"]
|
||||
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Test
|
||||
run: |
|
||||
swift test --enable-code-coverage
|
||||
@@ -61,6 +34,6 @@ jobs:
|
||||
-ignore-filename-regex="\/Benchmarks\/" \
|
||||
-instr-profile .build/debug/codecov/default.profdata > info.lcov
|
||||
- name: Upload to codecov.io
|
||||
uses: codecov/codecov-action@v3
|
||||
uses: codecov/codecov-action@v4
|
||||
with:
|
||||
file: info.lcov
|
||||
|
||||
14
.github/workflows/nightly.yml
vendored
14
.github/workflows/nightly.yml
vendored
@@ -1,20 +1,12 @@
|
||||
name: Swift nightly build
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 1 * * 1'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
macOS:
|
||||
runs-on: macOS-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: SPM tests
|
||||
run: swift test
|
||||
linux:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
strategy:
|
||||
matrix:
|
||||
image: ['nightly-focal', 'nightly-jammy', 'nightly-amazonlinux2']
|
||||
@@ -23,7 +15,7 @@ jobs:
|
||||
image: swiftlang/swift:${{ matrix.image }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
- name: Test
|
||||
run: |
|
||||
swift test --enable-test-discovery
|
||||
swift test
|
||||
|
||||
6
.github/workflows/validate.yml
vendored
6
.github/workflows/validate.yml
vendored
@@ -2,16 +2,14 @@ name: Validity Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 2.x.x
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: macOS-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Install Dependencies
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ xcuserdata/
|
||||
Package.resolved
|
||||
/public
|
||||
/docs
|
||||
.benchmarkBaselines
|
||||
@@ -1,14 +1,14 @@
|
||||
# Minimum swiftformat version
|
||||
--minversion 0.47.4
|
||||
--minversion 0.51.0
|
||||
|
||||
# Swift version
|
||||
--swiftversion 5.3
|
||||
--swiftversion 5.9
|
||||
|
||||
# file options
|
||||
--exclude .build
|
||||
|
||||
# rules
|
||||
--disable redundantReturn, extensionAccessControl
|
||||
--disable redundantReturn, extensionAccessControl, typeSugar
|
||||
|
||||
# format options
|
||||
--ifdef no-indent
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
## Legal
|
||||
By submitting a pull request, you represent that you have the right to license your contribution to the community, and agree by submitting the patch
|
||||
that your contributions are licensed under the Apache 2.0 license (see [LICENSE](LICENSE.txt)).
|
||||
that your contributions are licensed under the Apache 2.0 license (see [LICENSE](LICENSE)).
|
||||
|
||||
## Contributor Conduct
|
||||
All contributors are expected to adhere to the project's [Code of Conduct](CODE_OF_CONDUCT.md).
|
||||
@@ -30,4 +30,4 @@ The main development branch of the repository is `main`.
|
||||
|
||||
### Formatting
|
||||
|
||||
We use Nick Lockwood's SwiftFormat for formatting code. PRs will not be accepted if they haven't be formatted. The current version of SwiftFormat we are using is v0.48.17.
|
||||
We use Nick Lockwood's SwiftFormat for formatting code. PRs will not be accepted if they haven't be formatted. The current version of SwiftFormat we are using is v0.51.15.
|
||||
@@ -1,7 +1,7 @@
|
||||
# ================================
|
||||
# Build image
|
||||
# ================================
|
||||
FROM swift:5.7 as build
|
||||
FROM swift:5.9 as build
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
|
||||
@@ -63,21 +63,19 @@ struct HBMustacheContext {
|
||||
|
||||
/// return context with indent and parameter information for invoking a partial
|
||||
func withPartial(indented: String?, inheriting: [String: HBMustacheTemplate]?) -> HBMustacheContext {
|
||||
let indentation: String?
|
||||
if let indented = indented {
|
||||
indentation = (self.indentation ?? "") + indented
|
||||
let indentation: String? = if let indented {
|
||||
(self.indentation ?? "") + indented
|
||||
} else {
|
||||
indentation = self.indentation
|
||||
self.indentation
|
||||
}
|
||||
let inherits: [String: HBMustacheTemplate]?
|
||||
if let inheriting = inheriting {
|
||||
let inherits: [String: HBMustacheTemplate]? = if let inheriting {
|
||||
if let originalInherits = self.inherited {
|
||||
inherits = originalInherits.merging(inheriting) { value, _ in value }
|
||||
originalInherits.merging(inheriting) { value, _ in value }
|
||||
} else {
|
||||
inherits = inheriting
|
||||
inheriting
|
||||
}
|
||||
} else {
|
||||
inherits = self.inherited
|
||||
self.inherited
|
||||
}
|
||||
return .init(
|
||||
stack: self.stack,
|
||||
|
||||
@@ -182,7 +182,7 @@ extension HBMustacheTemplate {
|
||||
}
|
||||
// if we want to run a transform and the current child can have transforms applied to it then
|
||||
// run transform on the current child
|
||||
if let transform = transform {
|
||||
if let transform {
|
||||
if let runnable = child as? HBMustacheTransformable {
|
||||
return runnable.transform(transform)
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ import XCTest
|
||||
public struct AnyDecodable: Decodable {
|
||||
public let value: Any
|
||||
|
||||
public init<T>(_ value: T) {
|
||||
public init(_ value: some Any) {
|
||||
self.value = value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
##
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
SWIFT_FORMAT_VERSION=0.48.17
|
||||
SWIFT_FORMAT_VERSION=0.51.15
|
||||
|
||||
set -eu
|
||||
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
Reference in New Issue
Block a user