Skip to content

Commit

Permalink
add swiftlint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepistrol committed Feb 26, 2024
1 parent 00d7d72 commit 219d803
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
build-documentation:
runs-on: macOS-13
runs-on: macos-14
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on: push

jobs:
build:
runs-on: macOS-13
runs-on: macos-14
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: lint
on: push

jobs:
build:
runs-on: macos-14
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Run SwiftLint
run: |
swiftlint --strict
16 changes: 16 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
opt_in_rules:
- file_header

excluded:
- Package.swift
- TaskTriggerDemo

file_header:
severity: error
required_pattern: |
\/\/
\/\/ .+\.swift
\/\/ TaskTrigger
\/\/
\/\/ Created by .+ on \d{2}\.\d{2}\.\d{2}\.
\/\/
11 changes: 6 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// swift-tools-version: 5.8
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let taskTrigger = "TaskTrigger"

let package = Package(
name: "TaskTrigger",
name: taskTrigger,
platforms: [
.iOS(.v15),
.macOS(.v12),
Expand All @@ -14,13 +15,13 @@ let package = Package(
],
products: [
.library(
name: "TaskTrigger",
targets: ["TaskTrigger"]
name: taskTrigger,
targets: [taskTrigger]
),
],
targets: [
.target(
name: "TaskTrigger"
name: taskTrigger
),
]
)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flukepistrol%2FTaskTrigger%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/lukepistrol/TaskTrigger)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flukepistrol%2FTaskTrigger%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/lukepistrol/TaskTrigger)
[![](https://img.shields.io/github/license/lukepistrol/TaskTrigger)](https://github.com/lukepistrol/TaskTrigger/blob/main/LICENSE)

Attach async tasks to SwiftUI views using a trigger mechanism. See [this](#the-solution) for examples.

Expand Down
4 changes: 2 additions & 2 deletions Sources/TaskTrigger/TaskTriggerViewModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ struct TaskTriggerViewModifier<Value: Equatable>: ViewModifier where Value: Send
self.action = action
}

@Binding
@Binding
private var trigger: TaskTrigger<Value>

private let action: Action

func body(content: Content) -> some View {
Expand Down
2 changes: 1 addition & 1 deletion TaskTriggerDemo/TaskTriggerDemo/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct ContentView: View {

@State private var randomTrigger = TaskTrigger<Int>()
@State private var resetTrigger = PlainTaskTrigger()

var body: some View {
VStack {
Text(randomNumber, format: .number)
Expand Down

0 comments on commit 219d803

Please sign in to comment.