Skip to content

Commit 0ec6b15

Browse files
authored
Merge pull request #16 from MFB-Technologies-Inc/feature/update-workflow
Feature/update workflow
2 parents b2660f3 + f55ba61 commit 0ec6b15

32 files changed

+78
-160
lines changed

.devcontainer/devcontainer.json

+33-39
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,38 @@
11
{
2-
"name": "swift-argument-encoding",
3-
"image": "swift:5.7",
4-
"features": {
5-
"ghcr.io/devcontainers/features/common-utils:2": {
6-
"installZsh": "false",
7-
"username": "vscode",
8-
"userUid": "1000",
9-
"userGid": "1000",
10-
"upgradePackages": "false"
11-
},
12-
"ghcr.io/devcontainers/features/git:1": {
13-
"version": "os-provided",
14-
"ppa": "false"
15-
}
2+
"name": "swift-argument-encoding",
3+
"image": "swift:5.8",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "vscode",
8+
"userUid": "1000",
9+
"userGid": "1000",
10+
"upgradePackages": "false"
1611
},
17-
"runArgs": [
18-
"--cap-add=SYS_PTRACE",
19-
"--security-opt",
20-
"seccomp=unconfined"
21-
],
22-
// Configure tool-specific properties.
23-
"customizations": {
24-
// Configure properties specific to VS Code.
25-
"vscode": {
26-
// Set *default* container specific settings.json values on container create.
27-
"settings": {
28-
"lldb.library": "/usr/lib/liblldb.so"
29-
},
30-
// Add the IDs of extensions you want installed when the container is created.
31-
"extensions": [
32-
"sswg.swift-lang"
33-
]
34-
}
35-
},
36-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
37-
// "forwardPorts": [],
12+
"ghcr.io/devcontainers/features/git:1": {
13+
"version": "os-provided",
14+
"ppa": "false"
15+
}
16+
},
17+
"runArgs": ["--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined"],
18+
// Configure tool-specific properties.
19+
"customizations": {
20+
// Configure properties specific to VS Code.
21+
"vscode": {
22+
// Set *default* container specific settings.json values on container create.
23+
"settings": {
24+
"lldb.library": "/usr/lib/liblldb.so"
25+
},
26+
// Add the IDs of extensions you want installed when the container is created.
27+
"extensions": ["swiftlang.swift-vscode"]
28+
}
29+
},
30+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
31+
// "forwardPorts": [],
3832

39-
// Use 'postCreateCommand' to run commands after the container is created.
40-
"postCreateCommand": "swift --version",
33+
// Use 'postCreateCommand' to run commands after the container is created.
34+
"postCreateCommand": "swift --version",
4135

42-
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
43-
"remoteUser": "vscode"
36+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
37+
"remoteUser": "vscode"
4438
}

.github/workflows/ci.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,30 @@ on:
1111

1212
jobs:
1313
lint:
14-
runs-on: macos-13
14+
runs-on: macos-latest
1515
environment: default
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: SwiftFormat version
1919
run: swiftformat --version
2020
- name: Format lint
2121
run: swiftformat --lint .
22+
- name: Install SwiftLint
23+
run: brew install swiftlint
2224
- name: SwiftLint version
2325
run: swiftlint --version
2426
- name: Lint
2527
run: swiftlint lint --quiet
2628
macos-test:
27-
runs-on: macos-13
29+
runs-on: macos-latest
2830
environment: default
29-
strategy:
30-
matrix:
31-
xcode: ["14.3", "15.0"]
32-
# Swift: 5.8 , 5.9
3331
steps:
3432
- uses: actions/checkout@v4
35-
- name: Select Xcode ${{ matrix.xcode }}
36-
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
3733
- name: Run Tests
3834
run: swift test --enable-code-coverage --parallel
3935
- name: Swift Coverage Report
4036
run: xcrun llvm-cov export -format="lcov" .build/debug/swift-argument-encodingPackageTests.xctest/Contents/MacOS/swift-argument-encodingPackageTests -instr-profile .build/debug/codecov/default.profdata > coverage_report.lcov
41-
- uses: codecov/codecov-action@v4
37+
- uses: codecov/codecov-action@v5
4238
with:
4339
token: ${{ secrets.CODECOV_TOKEN }}
4440
fail_ci_if_error: true # optional (default = false)
@@ -47,6 +43,6 @@ jobs:
4743
environment: default
4844

4945
steps:
50-
- uses: actions/checkout@v3
46+
- uses: actions/checkout@v4
5147
- name: Run Tests
5248
run: swift test --parallel

.swiftformat

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
--redundanttype explicit
33
--swiftversion 5.8
44
--maxwidth 120
5-
--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."
5+
--header "{file}\nArgumentEncoding\n\nThis source code is licensed under the MIT License (MIT) found in the\nLICENSE file in the root directory of this source tree."
66
--allman false
77
--exclude **/output/**/*,.tuist-bin,**/.swiftpm/*,**/.build/*
88
--wraparguments before-first
9-
--wrapcollections before-first
9+
--wrapcollections before-first

Examples/Sources/SwiftCommand/RunCommand.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// RunCommand.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import ArgumentEncoding

Examples/Sources/SwiftCommand/SwiftCommand.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// SwiftCommand.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import ArgumentEncoding

Examples/Sources/SwiftCommand/TestCommand.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// TestCommand.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import ArgumentEncoding

Examples/Sources/SwiftCommand/main.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// main.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
let test = SwiftCommand.test(TestCommand(

Sources/ArgumentEncoding/ArgumentGroup.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// ArgumentGroup.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Dependencies

Sources/ArgumentEncoding/CaseConverter.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// CaseConverter.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Foundation

Sources/ArgumentEncoding/Command.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Command.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
/// A command type argument with no nested or children arguments.

Sources/ArgumentEncoding/CommandRepresentable.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// CommandRepresentable.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Dependencies

Sources/ArgumentEncoding/DecoderUserInfo+OptionHelpers.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// DecoderUserInfo+OptionHelpers.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Foundation

Sources/ArgumentEncoding/DecoderUserInfo+OptionSetHelpers.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// DecoderUserInfo+OptionSetHelpers.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Foundation

Sources/ArgumentEncoding/Flag.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Flag.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Dependencies

Sources/ArgumentEncoding/FormatterNode.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// FormatterNode.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
/// A protocol that describes a type that defines how flags and options are formatted. Typically, `ArgumentGroup`

Sources/ArgumentEncoding/Formatters.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Formatters.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Dependencies

Sources/ArgumentEncoding/Option.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// Option.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Dependencies

Sources/ArgumentEncoding/OptionSet.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// OptionSet.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Dependencies

Sources/ArgumentEncoding/PositionalArgument.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// PositionalArgument.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import Foundation

Sources/ArgumentEncoding/StaticString+Constants.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// StaticString+Constants.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
extension StaticString {

Sources/ArgumentEncoding/TopLevelCommandRepresentable.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// TopLevelCommandRepresentable.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
/// A type that represents a command type argument that is not a child of an `ArgumentGroup`.

Tests/ArgumentEncodingTests/ArgumentGroupTests.swift

+9-25
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// ArgumentGroupTests.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import ArgumentEncoding
@@ -250,28 +248,14 @@ final class ArgumentGroupTests: XCTestCase {
250248
}
251249
}
252250

253-
#if swift(>=6)
254-
extension Array: @retroactive ArgumentGroup, @retroactive FormatterNode {
255-
public var flagFormatter: ArgumentEncoding.FlagFormatter { FlagFormatter(prefix: .doubleDash) }
256-
257-
public var optionFormatter: ArgumentEncoding.OptionFormatter { OptionFormatter(prefix: .doubleDash) }
258-
}
259-
260-
extension Dictionary: @retroactive ArgumentGroup, @retroactive FormatterNode {
261-
public var flagFormatter: ArgumentEncoding.FlagFormatter { FlagFormatter(prefix: .doubleDash) }
262-
263-
public var optionFormatter: ArgumentEncoding.OptionFormatter { OptionFormatter(prefix: .doubleDash) }
264-
}
265-
#else
266-
extension Array: ArgumentGroup, FormatterNode {
267-
public var flagFormatter: ArgumentEncoding.FlagFormatter { FlagFormatter(prefix: .doubleDash) }
251+
extension Array: ArgumentGroup, FormatterNode {
252+
public var flagFormatter: ArgumentEncoding.FlagFormatter { FlagFormatter(prefix: .doubleDash) }
268253

269-
public var optionFormatter: ArgumentEncoding.OptionFormatter { OptionFormatter(prefix: .doubleDash) }
270-
}
254+
public var optionFormatter: ArgumentEncoding.OptionFormatter { OptionFormatter(prefix: .doubleDash) }
255+
}
271256

272-
extension Dictionary: ArgumentGroup, FormatterNode {
273-
public var flagFormatter: ArgumentEncoding.FlagFormatter { FlagFormatter(prefix: .doubleDash) }
257+
extension Dictionary: ArgumentGroup, FormatterNode {
258+
public var flagFormatter: ArgumentEncoding.FlagFormatter { FlagFormatter(prefix: .doubleDash) }
274259

275-
public var optionFormatter: ArgumentEncoding.OptionFormatter { OptionFormatter(prefix: .doubleDash) }
276-
}
277-
#endif
260+
public var optionFormatter: ArgumentEncoding.OptionFormatter { OptionFormatter(prefix: .doubleDash) }
261+
}

Tests/ArgumentEncodingTests/CommandRepresentableTests.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// CommandRepresentableTests.swift
22
// ArgumentEncoding
33
//
4-
// Copyright © 2024 MFB Technologies, Inc. All rights reserved.
5-
//
6-
// This source code is licensed under the MIT license found in the
4+
// This source code is licensed under the MIT License (MIT) found in the
75
// LICENSE file in the root directory of this source tree.
86

97
import ArgumentEncoding

0 commit comments

Comments
 (0)