Skip to content
Merged
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
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true

# 4 space indentation
[*.swift]
indent_style = space
indent_size = 4
4 changes: 2 additions & 2 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:

jobs:
doc:
runs-on: macos-latest
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Publish Jazzy Docs
uses: steven0351/publish-jazzy-docs@v1
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ on:

jobs:
test:
runs-on: macos-11
runs-on: macos-latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Lint code
run: swiftlint lint
- name: Lint PR code
uses: stanfordbdhg/action-swiftlint@v4
env:
DIFF_BASE: ${{ github.base_ref }}

- name: Run tests
run: swift test --enable-test-discovery
run: swift test
1 change: 0 additions & 1 deletion Sources/SimpleHTTP/Interceptor/CompositeInterceptor.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import Combine

/// Use an Array of `Interceptor` as a single `Interceptor`
public struct CompositeInterceptor: ExpressibleByArrayLiteral, Sequence {
Expand Down
1 change: 0 additions & 1 deletion Sources/SimpleHTTP/Interceptor/Interceptor.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Foundation
import Combine

public typealias Interceptor = RequestInterceptor & ResponseInterceptor

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import Foundation

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

extension URLRequest {
/// Return a new URLRequest whose path is relative to `baseURL`
public func relativeTo(_ baseURL: URL) -> URLRequest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import Foundation

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

extension URLSession {
@available(iOS, deprecated: 15.0, message: "Use built-in API instead")
public func data(for urlRequest: URLRequest) async throws -> (Data, URLResponse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import Foundation
import XCTest
@testable import SimpleHTTPFoundation

#if canImport(FoundationNetworking)
import FoundationNetworking
#endif

class URLRequestURLTests: XCTestCase {
func test_relativeTo_requestURLHasBaseURL() {
let request = URLRequest(url: URL(string: "path")!)
Expand Down
6 changes: 0 additions & 6 deletions Tests/SimpleHTTPTests/Response/URLDataResponseTests.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import XCTest
import Combine
@testable import SimpleHTTP

class URLDataResponseTests: XCTestCase {
var cancellables: Set<AnyCancellable> = []

override func tearDown() {
cancellables = []
}

func test_validate_responseIsError_dataIsEmpty_converterIsNotCalled() throws {
let response = URLDataResponse(data: Data(), response: HTTPURLResponse.notFound)
Expand Down
1 change: 0 additions & 1 deletion Tests/SimpleHTTPTests/Session/SessionTests.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import XCTest
import Combine
@testable import SimpleHTTP

class SessionAsyncTests: XCTestCase {
Expand Down