Skip to content

Commit

Permalink
Merge pull request #10 from MFB-Technologies-Inc/fix-file-headers
Browse files Browse the repository at this point in the history
  • Loading branch information
roanutil authored Sep 14, 2023
2 parents cb64d3b + 64ea4d3 commit ee02af2
Show file tree
Hide file tree
Showing 32 changed files with 100 additions and 9 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ jobs:
environment: default
steps:
- uses: actions/checkout@v3
- name: SwiftFormat version
run: swiftformat --version
- name: Format lint
run: swiftformat --lint .
- name: SwiftLint version
run: swiftlint --version
- name: Lint
run: swiftlint .
run: swiftlint lint --quiet
macos-test:
runs-on: macos-13
environment: default
Expand Down
2 changes: 1 addition & 1 deletion .swiftformat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
--redundanttype explicit
--swiftversion 5.7
--maxwidth 120
--header "{file}\nArgumentEncoding\n\nCopyright © {year} MFB Technologies, Inc. All rights reserved."
--header "{file}\nArgumentEncoding\n\nCopyright © {year} MFB Technologies, Inc. All rights reserved.\n\nThis source code is licensed under the MIT license found in the\nLICENSE file in the root directory of this source tree."
--allman false
--exclude **/output/**/*,.tuist-bin,**/.swiftpm/*,**/.build/*
--wraparguments before-first
Expand Down
3 changes: 3 additions & 0 deletions Examples/Sources/SwiftCommand/RunCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding

Expand Down
3 changes: 3 additions & 0 deletions Examples/Sources/SwiftCommand/SwiftCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding

Expand Down
3 changes: 3 additions & 0 deletions Examples/Sources/SwiftCommand/TestCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding

Expand Down
3 changes: 3 additions & 0 deletions Examples/Sources/SwiftCommand/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

let test = SwiftCommand.test(TestCommand(
parallel: true,
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "302891700c7fa3b92ebde9fe7b42933f8349f3c7",
"version" : "1.0.0"
"revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631",
"version" : "1.0.2"
}
}
],
Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/ArgumentGroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Dependencies

Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/CaseConverter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Foundation

Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/Command.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

/// A command type argument with no nested or children arguments.
public struct Command: Hashable, Sendable, RawRepresentable {
Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/CommandRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Dependencies

Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/DecoderUserInfo+OptionHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Foundation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Foundation

Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/Flag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Dependencies

Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/FormatterNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

/// A protocol that describes a type that defines how flags and options are formatted. Typically, `ArgumentGroup`
/// conforming types would be formatter nodes so that all their children will inherit the specified formatters.
Expand Down
7 changes: 5 additions & 2 deletions Sources/ArgumentEncoding/Formatters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Dependencies
import XCTestDynamicOverlay
Expand All @@ -18,7 +21,7 @@ public struct FlagFormatter: Sendable {
}

@Sendable
internal func _format(encoding: FlagEncoding) -> String {
func _format(encoding: FlagEncoding) -> String {
format(key: encoding.key)
}

Expand Down Expand Up @@ -58,7 +61,7 @@ public struct OptionFormatter: Sendable {
prefix() + body(key) + separator() + value
}

internal func format(encoding: OptionEncoding) -> String {
func format(encoding: OptionEncoding) -> String {
format(key: encoding.key, value: encoding.value)
}

Expand Down
5 changes: 4 additions & 1 deletion Sources/ArgumentEncoding/Option.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Dependencies
import Foundation
Expand Down Expand Up @@ -38,7 +41,7 @@ public struct Option<Value>: OptionProtocol {
// Different Value types will encode to arguments differently.
// Using unwrap, this can be handled individually per type or collectively by protocol
private let unwrap: @Sendable (Value) -> String?
internal var unwrapped: String? {
var unwrapped: String? {
unwrap(wrappedValue)
}

Expand Down
5 changes: 4 additions & 1 deletion Sources/ArgumentEncoding/OptionSet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Dependencies
import Foundation
Expand Down Expand Up @@ -40,7 +43,7 @@ public struct OptionSet<Value>: OptionSetProtocol where Value: Sequence {
// Different Value types will encode to arguments differently.
// Using unwrap, this can be handled individually per type or collectively by protocol
private let unwrap: @Sendable (Value.Element) -> String?
internal var unwrapped: [String] {
var unwrapped: [String] {
wrappedValue.compactMap(unwrap)
}

Expand Down
5 changes: 4 additions & 1 deletion Sources/ArgumentEncoding/PositionalArgument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import Foundation

Expand All @@ -26,7 +29,7 @@ public struct Positional<Value>: PositionalProtocol {
// Different Value types will encode to arguments differently.
// Using unwrap, this can be handled individually per type or collectively by protocol
private let unwrap: @Sendable (Value) -> [String]
internal var unwrapped: [String] {
var unwrapped: [String] {
unwrap(wrappedValue)
}

Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/StaticString+Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

extension StaticString {
public static let space: Self = #" "#
Expand Down
3 changes: 3 additions & 0 deletions Sources/ArgumentEncoding/TopLevelCommandRepresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

/// A type that represents a command type argument that is not a child of an `ArgumentGroup`.
///
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/ArgumentGroupTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Dependencies
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/CommandRepresentableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import XCTest
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/CommandTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import XCTest
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/FlagTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Dependencies
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/FormatterTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Foundation
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/OptionDecodingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Foundation
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/OptionSetDecodingTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Foundation
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/OptionSetTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Dependencies
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/OptionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Dependencies
Expand Down
3 changes: 3 additions & 0 deletions Tests/ArgumentEncodingTests/PositionalTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import Dependencies
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// ArgumentEncoding
//
// Copyright © 2023 MFB Technologies, Inc. All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.

import ArgumentEncoding
import XCTest
Expand Down

0 comments on commit ee02af2

Please sign in to comment.